diff options
| author | Yury Selivanov <yselivanov@sprymix.com> | 2015-11-17 17:20:26 (GMT) |
|---|---|---|
| committer | Yury Selivanov <yselivanov@sprymix.com> | 2015-11-17 17:20:26 (GMT) |
| commit | 4990289bbf6d51130855fd0a54c3726f60ee9fdf (patch) | |
| tree | 90650af56f9495acf7ea19045e2e61d5eadfb45c /Lib/test/test_asyncio/test_futures.py | |
| parent | cfcc2bdcb2e721050fc0ddbdafd2f6452b845a24 (diff) | |
| parent | 5498f2b6bf6d2ff7a1575a7a07ca1175f8226853 (diff) | |
| download | cpython-4990289bbf6d51130855fd0a54c3726f60ee9fdf.zip cpython-4990289bbf6d51130855fd0a54c3726f60ee9fdf.tar.gz cpython-4990289bbf6d51130855fd0a54c3726f60ee9fdf.tar.bz2 | |
Merge 3.5
Diffstat (limited to 'Lib/test/test_asyncio/test_futures.py')
| -rw-r--r-- | Lib/test/test_asyncio/test_futures.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/Lib/test/test_asyncio/test_futures.py b/Lib/test/test_asyncio/test_futures.py index 0bc0581..55fdff3 100644 --- a/Lib/test/test_asyncio/test_futures.py +++ b/Lib/test/test_asyncio/test_futures.py @@ -174,11 +174,13 @@ class FutureTests(test_utils.TestCase): '<Future cancelled>') def test_copy_state(self): + from asyncio.futures import _copy_future_state + f = asyncio.Future(loop=self.loop) f.set_result(10) newf = asyncio.Future(loop=self.loop) - newf._copy_state(f) + _copy_future_state(f, newf) self.assertTrue(newf.done()) self.assertEqual(newf.result(), 10) @@ -186,7 +188,7 @@ class FutureTests(test_utils.TestCase): f_exception.set_exception(RuntimeError()) newf_exception = asyncio.Future(loop=self.loop) - newf_exception._copy_state(f_exception) + _copy_future_state(f_exception, newf_exception) self.assertTrue(newf_exception.done()) self.assertRaises(RuntimeError, newf_exception.result) @@ -194,7 +196,7 @@ class FutureTests(test_utils.TestCase): f_cancelled.cancel() newf_cancelled = asyncio.Future(loop=self.loop) - newf_cancelled._copy_state(f_cancelled) + _copy_future_state(f_cancelled, newf_cancelled) self.assertTrue(newf_cancelled.cancelled()) def test_iter(self): @@ -382,9 +384,10 @@ class FutureTests(test_utils.TestCase): self.check_future_exception_never_retrieved(True) def test_set_result_unless_cancelled(self): + from asyncio import futures fut = asyncio.Future(loop=self.loop) fut.cancel() - fut._set_result_unless_cancelled(2) + futures._set_result_unless_cancelled(fut, 2) self.assertTrue(fut.cancelled()) |
