summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio/test_utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/asyncio/test_utils.py')
-rw-r--r--Lib/asyncio/test_utils.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/asyncio/test_utils.py b/Lib/asyncio/test_utils.py
index fdd3ba0..99e3839 100644
--- a/Lib/asyncio/test_utils.py
+++ b/Lib/asyncio/test_utils.py
@@ -449,7 +449,13 @@ class TestCase(unittest.TestCase):
self.set_event_loop(loop)
return loop
+ def setUp(self):
+ self._get_running_loop = events._get_running_loop
+ events._get_running_loop = lambda: None
+
def tearDown(self):
+ events._get_running_loop = self._get_running_loop
+
events.set_event_loop(None)
# Detect CPython bug #23353: ensure that yield/yield-from is not used