summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_asyncio/test_futures.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_asyncio/test_futures.py')
-rw-r--r--Lib/test/test_asyncio/test_futures.py11
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())