summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_asyncio
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_asyncio')
-rw-r--r--Lib/test/test_asyncio/test_subprocess.py12
-rw-r--r--Lib/test/test_asyncio/test_tasks.py4
-rw-r--r--Lib/test/test_asyncio/test_unix_events.py6
3 files changed, 17 insertions, 5 deletions
diff --git a/Lib/test/test_asyncio/test_subprocess.py b/Lib/test/test_asyncio/test_subprocess.py
index 1b2f05b..14fd17e 100644
--- a/Lib/test/test_asyncio/test_subprocess.py
+++ b/Lib/test/test_asyncio/test_subprocess.py
@@ -21,6 +21,7 @@ PROGRAM_CAT = [
'sys.stdout.buffer.write(data)'))]
class SubprocessMixin:
+
def test_stdin_stdout(self):
args = PROGRAM_CAT
@@ -132,6 +133,7 @@ class SubprocessMixin:
if sys.platform != 'win32':
# Unix
class SubprocessWatcherMixin(SubprocessMixin):
+
Watcher = None
def setUp(self):
@@ -151,14 +153,20 @@ if sys.platform != 'win32':
self.loop.close()
policy.set_event_loop(None)
- class SubprocessSafeWatcherTests(SubprocessWatcherMixin, unittest.TestCase):
+ class SubprocessSafeWatcherTests(SubprocessWatcherMixin,
+ unittest.TestCase):
+
Watcher = unix_events.SafeChildWatcher
- class SubprocessFastWatcherTests(SubprocessWatcherMixin, unittest.TestCase):
+ class SubprocessFastWatcherTests(SubprocessWatcherMixin,
+ unittest.TestCase):
+
Watcher = unix_events.FastChildWatcher
+
else:
# Windows
class SubprocessProactorTests(SubprocessMixin, unittest.TestCase):
+
def setUp(self):
policy = asyncio.get_event_loop_policy()
self.loop = asyncio.ProactorEventLoop()
diff --git a/Lib/test/test_asyncio/test_tasks.py b/Lib/test/test_asyncio/test_tasks.py
index 024dd2e..f27b952 100644
--- a/Lib/test/test_asyncio/test_tasks.py
+++ b/Lib/test/test_asyncio/test_tasks.py
@@ -876,6 +876,7 @@ class TaskTests(unittest.TestCase):
self.assertEqual(set(f.result() for f in done), {'a', 'b'})
def test_as_completed_duplicate_coroutines(self):
+
@asyncio.coroutine
def coro(s):
return s
@@ -884,7 +885,8 @@ class TaskTests(unittest.TestCase):
def runner():
result = []
c = coro('ham')
- for f in asyncio.as_completed([c, c, coro('spam')], loop=self.loop):
+ for f in asyncio.as_completed([c, c, coro('spam')],
+ loop=self.loop):
result.append((yield from f))
return result
diff --git a/Lib/test/test_asyncio/test_unix_events.py b/Lib/test/test_asyncio/test_unix_events.py
index c0f205e..9e489c2 100644
--- a/Lib/test/test_asyncio/test_unix_events.py
+++ b/Lib/test/test_asyncio/test_unix_events.py
@@ -367,7 +367,8 @@ class UnixReadPipeTransportTests(unittest.TestCase):
tr._close.assert_called_with(err)
m_logexc.assert_called_with(
test_utils.MockPattern(
- 'Fatal read error on pipe transport\nprotocol:.*\ntransport:.*'),
+ 'Fatal read error on pipe transport'
+ '\nprotocol:.*\ntransport:.*'),
exc_info=(OSError, MOCK_ANY, MOCK_ANY))
@unittest.mock.patch('os.read')
@@ -664,7 +665,8 @@ class UnixWritePipeTransportTests(unittest.TestCase):
self.assertTrue(tr._closing)
m_logexc.assert_called_with(
test_utils.MockPattern(
- 'Fatal write error on pipe transport\nprotocol:.*\ntransport:.*'),
+ 'Fatal write error on pipe transport'
+ '\nprotocol:.*\ntransport:.*'),
exc_info=(OSError, MOCK_ANY, MOCK_ANY))
self.assertEqual(1, tr._conn_lost)
test_utils.run_briefly(self.loop)