Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add a comment about clearing the policy.
  • Loading branch information
ericsnowcurrently committed Oct 18, 2024
commit 216cc99fbbb0439b0c52aeac911bf147478497a0
12 changes: 8 additions & 4 deletions Lib/test/test_concurrent_futures/test_interpreter_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,12 +284,16 @@ class AsyncioTest(InterpretersMixin, testasyncio_utils.TestCase):

@classmethod
def setUpClass(cls):
# Most uses of asyncio will implicitly call set_event_loop_policy()
# with the default policy if a policy hasn't been set already.
# If that happens in a test, likw here, we'll end up with a failure
Comment thread
ericsnowcurrently marked this conversation as resolved.
Outdated
# when --fail-env-changed is used. That's why the other tests that
# use asyncio are careful to set the policy back to None and why
# we're careful to do so here. We also validate that no other
# tests left a policy in place, just in case.
policy = support.maybe_get_event_loop_policy()
assert policy is None, policy

@classmethod
def tearDownClass(cls):
asyncio.set_event_loop_policy(None)
cls.addClassCleanup(lambda: asyncio.set_event_loop_policy(None))

Comment thread
ZeroIntensity marked this conversation as resolved.
def setUp(self):
super().setUp()
Expand Down