summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_asyncio/test_tasks.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_asyncio/test_tasks.py')
-rw-r--r--Lib/test/test_asyncio/test_tasks.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/Lib/test/test_asyncio/test_tasks.py b/Lib/test/test_asyncio/test_tasks.py
index 7d6d056..b536322 100644
--- a/Lib/test/test_asyncio/test_tasks.py
+++ b/Lib/test/test_asyncio/test_tasks.py
@@ -212,8 +212,8 @@ class BaseTaskTests:
self.assertEqual(t.result(), 'ok')
# Deprecated in 3.10, undeprecated in 3.12
- asyncio.set_event_loop(self.loop)
- self.addCleanup(asyncio.set_event_loop, None)
+ asyncio._set_event_loop(self.loop)
+ self.addCleanup(asyncio._set_event_loop, None)
t = asyncio.ensure_future(notmuch())
self.assertIs(t._loop, self.loop)
self.loop.run_until_complete(t)
@@ -2202,8 +2202,8 @@ class BaseTaskTests:
async def coro():
return 42
- asyncio.set_event_loop(self.loop)
- self.addCleanup(asyncio.set_event_loop, None)
+ asyncio._set_event_loop(self.loop)
+ self.addCleanup(asyncio._set_event_loop, None)
outer = asyncio.shield(coro())
self.assertEqual(outer._loop, self.loop)
res = self.loop.run_until_complete(outer)
@@ -2273,7 +2273,7 @@ class BaseTaskTests:
self.assertEqual(self.all_tasks(loop=self.loop), {task})
- asyncio.set_event_loop(None)
+ asyncio._set_event_loop(None)
# execute the task so it waits for future
self.loop._run_once()
@@ -3278,8 +3278,8 @@ class FutureGatherTests(GatherTestsBase, test_utils.TestCase):
def test_constructor_empty_sequence_use_global_loop(self):
# Deprecated in 3.10, undeprecated in 3.12
- asyncio.set_event_loop(self.one_loop)
- self.addCleanup(asyncio.set_event_loop, None)
+ asyncio._set_event_loop(self.one_loop)
+ self.addCleanup(asyncio._set_event_loop, None)
fut = asyncio.gather()
self.assertIsInstance(fut, asyncio.Future)
self.assertIs(fut._loop, self.one_loop)
@@ -3386,8 +3386,8 @@ class CoroutineGatherTests(GatherTestsBase, test_utils.TestCase):
# Deprecated in 3.10, undeprecated in 3.12
async def coro():
return 'abc'
- asyncio.set_event_loop(self.other_loop)
- self.addCleanup(asyncio.set_event_loop, None)
+ asyncio._set_event_loop(self.other_loop)
+ self.addCleanup(asyncio._set_event_loop, None)
gen1 = coro()
gen2 = coro()
fut = asyncio.gather(gen1, gen2)