Skip to content

Commit

Permalink
Make sure we clean up timers too
Browse files Browse the repository at this point in the history
  • Loading branch information
elupus committed Nov 27, 2022
1 parent 7485ba3 commit 4d1335f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,11 @@ def verify_cleanup(event_loop: asyncio.AbstractEventLoop):
if tasks:
event_loop.run_until_complete(asyncio.wait(tasks))

for handle in event_loop._scheduled: # pylint: disable=protected-access
if not handle.cancelled():
warnings.warn(f"Lingering timer after test {handle}")
handle.cancel()


@pytest.fixture(autouse=True)
def bcrypt_cost():
Expand Down

0 comments on commit 4d1335f

Please sign in to comment.