From a46a718693aa8330fd4acf0ac13b51360273b8b5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 6 May 2025 10:38:31 +0000 Subject: [PATCH 1/2] build(deps-dev): bump the pytest-dependencies group across 1 directory with 3 updates Bumps the pytest-dependencies group with 3 updates in the / directory: [pytest](https://github.com/pytest-dev/pytest), [pytest-asyncio](https://github.com/pytest-dev/pytest-asyncio) and [pytest-cov](https://github.com/pytest-dev/pytest-cov). Updates `pytest` from 8.3.4 to 8.3.5 - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest/compare/8.3.4...8.3.5) Updates `pytest-asyncio` from 0.25.0 to 0.26.0 - [Release notes](https://github.com/pytest-dev/pytest-asyncio/releases) - [Commits](https://github.com/pytest-dev/pytest-asyncio/compare/v0.25.0...v0.26.0) Updates `pytest-cov` from 6.0.0 to 6.1.0 - [Changelog](https://github.com/pytest-dev/pytest-cov/blob/master/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest-cov/compare/v6.0.0...v6.1.0) --- updated-dependencies: - dependency-name: pytest dependency-type: direct:development update-type: version-update:semver-patch dependency-group: pytest-dependencies - dependency-name: pytest-asyncio dependency-type: direct:development update-type: version-update:semver-minor dependency-group: pytest-dependencies - dependency-name: pytest-cov dependency-type: direct:development update-type: version-update:semver-minor dependency-group: pytest-dependencies ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 From 3318839a6962f14f0b0070cc0752ad6ccc4df520 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Sat, 10 May 2025 23:03:29 -0400 Subject: [PATCH 2/2] tests(pytest-asyncio): add custom event_loop fixture --- tests/conftest.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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()