Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
code review
  • Loading branch information
kumaraditya303 authored Aug 16, 2022
commit 33243540d5839e48d45525551dbc9d620ae1ddd3
2 changes: 1 addition & 1 deletion Lib/test/test_unittest/test_async_case.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ def test_setup_get_event_loop(self):

class TestCase1(unittest.IsolatedAsyncioTestCase):
def setUp(self):
self.loop = asyncio.get_event_loop_policy().get_event_loop()
asyncio.get_event_loop_policy().get_event_loop()

async def test_demo1(self):
pass
Expand Down
4 changes: 3 additions & 1 deletion Lib/unittest/async_case.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,9 @@ def _setupAsyncioRunner(self):
assert self._asyncioRunner is None, 'asyncio runner is already initialized'
runner = asyncio.Runner(debug=True)
self._asyncioRunner = runner
# Force loop to be initialized
# 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()
Comment thread
kumaraditya303 marked this conversation as resolved.

def _tearDownAsyncioRunner(self):
Expand Down