Skip to content

Commit

Permalink
Improve the logic around loop closing + comment
Browse files Browse the repository at this point in the history
  • Loading branch information
artem-shelkovnikov committed Nov 3, 2023
1 parent 93de55c commit 23c1fc1
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -936,7 +936,9 @@ async def test_get_event_loop_uvloop_when_runtime_exception():
returned_loop = get_event_loop()

assert loop == returned_loop
returned_loop.close()
# We need to close the loop here because we've created one.
# Previous tests operate on already opened loop, thus it's closed
# by the test automatically
loop.close()


Expand All @@ -948,10 +950,7 @@ async def test_get_event_loop_uvloop_when_runtime_exception_and_loop_policy_has_
"asyncio.get_event_loop_policy", return_value=event_loop_policy_mock
):
loop = get_event_loop()

assert True

loop.close()
assert loop is not None


@pytest.mark.parametrize(
Expand Down

0 comments on commit 23c1fc1

Please sign in to comment.