Skip to content

Commit 2e55a60

Browse files
author
Vincent Michel
committed
Ignore event loop policy warnings during the tests
1 parent 705a54c commit 2e55a60

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

asyncio/test_utils.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,8 @@ def set_event_loop(self, loop, *, cleanup=True):
407407
assert loop is not None
408408
# ensure that the event loop is passed explicitly in asyncio
409409
events.set_event_loop(None)
410+
# Disable event loop policy warnings
411+
events.get_event_loop_policy()._warnings = False
410412
if cleanup:
411413
self.addCleanup(loop.close)
412414

@@ -417,6 +419,8 @@ def new_test_loop(self, gen=None):
417419

418420
def tearDown(self):
419421
events.set_event_loop(None)
422+
# Enable event loop policy warnings
423+
events.get_event_loop_policy()._warnings = True
420424

421425
# Detect CPython bug #23353: ensure that yield/yield-from is not used
422426
# in an except block of a generator

0 commit comments

Comments
 (0)