diff --git a/requirements-dev.txt b/requirements-dev.txt index 34b5155..9cd5ec4 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,6 +1,6 @@ betamax==0.9.0 betamax-serializers==0.2.1 -pytest==8.3.4 -pytest-asyncio==0.25.0 -pytest-cov==6.0.0 +pytest==8.3.5 +pytest-asyncio==0.26.0 +pytest-cov==6.1.1 pytest-mock==3.14.0 diff --git a/tests/conftest.py b/tests/conftest.py index 6a8d14a..f732902 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,4 +1,5 @@ # standard imports +import asyncio import os import time @@ -66,3 +67,17 @@ def no_github_token(): yield os.environ['GITHUB_TOKEN'] = og_token + + +@pytest.fixture(scope="session") +def event_loop(): + """ + Create an event loop that isn't closed after each test. + + This is necessary for pytest-asyncio 0.26.0 and later, as it fails to closes the loop after each test. + """ + loop = asyncio.new_event_loop() + asyncio.set_event_loop(loop) + yield loop + + loop.close()