diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2025-07-09 08:34:19 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-07-09 08:34:19 (GMT) |
commit | c29fce05f3b4558f2dcd91ccaac5ab646caf6c1c (patch) | |
tree | 6f4a5e64975f38f477b0cae85c6ca82a292d1fc1 /Lib/test/test_asyncio/test_runners.py | |
parent | a9d2f08b579a400e0f2a337116bb29f476249dff (diff) | |
download | cpython-c29fce05f3b4558f2dcd91ccaac5ab646caf6c1c.zip cpython-c29fce05f3b4558f2dcd91ccaac5ab646caf6c1c.tar.gz cpython-c29fce05f3b4558f2dcd91ccaac5ab646caf6c1c.tar.bz2 |
[3.14] gh-134657: Remove newly added private names from asyncio.__all__ (GH-134665) (#136455)
gh-134657: Remove newly added private names from asyncio.__all__ (GH-134665)
(cherry picked from commit 797abd1f7fdeb744bf9f683ef844e7279aad3d72)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Diffstat (limited to 'Lib/test/test_asyncio/test_runners.py')
-rw-r--r-- | Lib/test/test_asyncio/test_runners.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Lib/test/test_asyncio/test_runners.py b/Lib/test/test_asyncio/test_runners.py index 21f277b..8a4d7f5 100644 --- a/Lib/test/test_asyncio/test_runners.py +++ b/Lib/test/test_asyncio/test_runners.py @@ -12,14 +12,14 @@ from unittest.mock import patch def tearDownModule(): - asyncio._set_event_loop_policy(None) + asyncio.events._set_event_loop_policy(None) def interrupt_self(): _thread.interrupt_main() -class TestPolicy(asyncio._AbstractEventLoopPolicy): +class TestPolicy(asyncio.events._AbstractEventLoopPolicy): def __init__(self, loop_factory): self.loop_factory = loop_factory @@ -61,15 +61,15 @@ class BaseTest(unittest.TestCase): super().setUp() policy = TestPolicy(self.new_loop) - asyncio._set_event_loop_policy(policy) + asyncio.events._set_event_loop_policy(policy) def tearDown(self): - policy = asyncio._get_event_loop_policy() + policy = asyncio.events._get_event_loop_policy() if policy.loop is not None: self.assertTrue(policy.loop.is_closed()) self.assertTrue(policy.loop.shutdown_ag_run) - asyncio._set_event_loop_policy(None) + asyncio.events._set_event_loop_policy(None) super().tearDown() @@ -208,7 +208,7 @@ class RunTests(BaseTest): await asyncio.sleep(0) return 42 - policy = asyncio._get_event_loop_policy() + policy = asyncio.events._get_event_loop_policy() policy.set_event_loop = mock.Mock() asyncio.run(main()) self.assertTrue(policy.set_event_loop.called) @@ -259,7 +259,7 @@ class RunTests(BaseTest): loop.set_task_factory(Task) return loop - asyncio._set_event_loop_policy(TestPolicy(new_event_loop)) + asyncio.events._set_event_loop_policy(TestPolicy(new_event_loop)) with self.assertRaises(asyncio.CancelledError): asyncio.run(main()) @@ -495,7 +495,7 @@ class RunnerTests(BaseTest): async def coro(): pass - policy = asyncio._get_event_loop_policy() + policy = asyncio.events._get_event_loop_policy() policy.set_event_loop = mock.Mock() runner = asyncio.Runner() runner.run(coro()) |