]> granicus.if.org Git - python/commitdiff
Issue #24763: Fix asyncio test on Windows (fix reverted change)
authorYury Selivanov <yselivanov@sprymix.com>
Sun, 9 Aug 2015 22:21:25 +0000 (18:21 -0400)
committerYury Selivanov <yselivanov@sprymix.com>
Sun, 9 Aug 2015 22:21:25 +0000 (18:21 -0400)
See also issue #24835

Lib/test/test_asyncio/test_subprocess.py

index d138c263c1c1cc6d33acdc3dd473b41ae4c7ecf3..38f0ceeb1f2bd561862be5a10c3360fef41ce5ec 100644 (file)
@@ -417,7 +417,11 @@ class SubprocessMixin:
     def test_popen_error(self):
         # Issue #24763: check that the subprocess transport is closed
         # when BaseSubprocessTransport fails
-        with mock.patch('subprocess.Popen') as popen:
+        if sys.platform == 'win32':
+            target = 'asyncio.windows_utils.Popen'
+        else:
+            target = 'subprocess.Popen'
+        with mock.patch(target) as popen:
             exc = ZeroDivisionError
             popen.side_effect = exc