mirror of
https://github.com/python/cpython.git
synced 2025-10-05 06:31:48 +00:00
This commit is contained in:
parent
a6e84933d2
commit
01e5230ef0
4 changed files with 36 additions and 2 deletions
|
@ -449,12 +449,15 @@ class TestCase(unittest.TestCase):
|
|||
self.set_event_loop(loop)
|
||||
return loop
|
||||
|
||||
def unpatch_get_running_loop(self):
|
||||
events._get_running_loop = self._get_running_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
|
||||
self.unpatch_get_running_loop()
|
||||
|
||||
events.set_event_loop(None)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue