diff options
| author | Yury Selivanov <yselivanov@sprymix.com> | 2015-05-11 22:24:00 -0400 |
|---|---|---|
| committer | Yury Selivanov <yselivanov@sprymix.com> | 2015-05-11 22:24:00 -0400 |
| commit | 36e714117f1e1e88d2358dccbea19947752d9d5f (patch) | |
| tree | bf1ecfd25263d0bea613d3948a7285845762a363 /tests | |
| parent | e3216b80438bf42abb76c99b034eb03b2768018d (diff) | |
| download | trollius-git-36e714117f1e1e88d2358dccbea19947752d9d5f.tar.gz | |
Support PEP 492 native coroutines.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_base_events.py | 3 | ||||
| -rw-r--r-- | tests/test_tasks.py | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/tests/test_base_events.py b/tests/test_base_events.py index 8c4498c..b1f1e56 100644 --- a/tests/test_base_events.py +++ b/tests/test_base_events.py @@ -61,7 +61,8 @@ class BaseEventLoopTests(test_utils.TestCase): NotImplementedError, self.loop._make_write_pipe_transport, m, m) gen = self.loop._make_subprocess_transport(m, m, m, m, m, m, m) - self.assertRaises(NotImplementedError, next, iter(gen)) + with self.assertRaises(NotImplementedError): + gen.send(None) def test_close(self): self.assertFalse(self.loop.is_closed()) diff --git a/tests/test_tasks.py b/tests/test_tasks.py index 4119085..6541df7 100644 --- a/tests/test_tasks.py +++ b/tests/test_tasks.py @@ -1638,7 +1638,7 @@ class TaskTests(test_utils.TestCase): return a def call(arg): - cw = asyncio.coroutines.CoroWrapper(foo(), foo) + cw = asyncio.coroutines.CoroWrapper(foo()) cw.send(None) try: cw.send(arg) @@ -1653,7 +1653,7 @@ class TaskTests(test_utils.TestCase): def test_corowrapper_weakref(self): wd = weakref.WeakValueDictionary() def foo(): yield from [] - cw = asyncio.coroutines.CoroWrapper(foo(), foo) + cw = asyncio.coroutines.CoroWrapper(foo()) wd['cw'] = cw # Would fail without __weakref__ slot. cw.gen = None # Suppress warning from __del__. |
