[3.11] GH-95736: fix IsolatedAsyncioTestCase to initialize Runner bef… (#96042)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
Kumar Aditya 2022-08-18 19:12:16 +05:30 committed by GitHub
parent 1b9b4856c8
commit b68ea2a3e4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 0 deletions

View file

@ -79,6 +79,10 @@ class IsolatedAsyncioTestCase(TestCase):
return result
def _callSetUp(self):
# 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.
self._asyncioRunner.get_loop()
self._asyncioTestContext.run(self.setUp)
self._callAsync(self.asyncSetUp)