mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
GH-95736: fix IsolatedAsyncioTestCase to initialize Runner before calling setup functions (#95898)
This commit is contained in:
parent
5a8c15819c
commit
9d515997f9
3 changed files with 20 additions and 0 deletions
|
@ -116,6 +116,10 @@ class IsolatedAsyncioTestCase(TestCase):
|
|||
assert self._asyncioRunner is None, 'asyncio runner is already initialized'
|
||||
runner = asyncio.Runner(debug=True)
|
||||
self._asyncioRunner = runner
|
||||
# Force loop to be initialized and set as the current loop
|
||||
# so that setUp functions can use get_event_loop() and get the
|
||||
# correct loop instance.
|
||||
runner.get_loop()
|
||||
|
||||
def _tearDownAsyncioRunner(self):
|
||||
runner = self._asyncioRunner
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue