From f9c13293e0b551dc6845cee981ac186029d3aa06 Mon Sep 17 00:00:00 2001 From: Guido Schmitz Date: Fri, 29 Nov 2024 08:17:47 +0100 Subject: [PATCH 1/2] Fix tests --- tests/conftest.py | 11 ----------- tests/test_api.py | 2 ++ 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 819d8d9..142269b 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -16,14 +16,3 @@ def test_data_fixture(request): with file.open("r") as fh: test_data = json.load(fh) setattr(request.cls, filename, test_data) - - -@pytest.fixture() -def event_loop(): - loop = asyncio.get_event_loop() - yield loop - to_cancel = asyncio.tasks.all_tasks(loop) - for task in to_cancel: - task.cancel() - loop.run_until_complete(asyncio.tasks.gather(*to_cancel, return_exceptions=True)) - loop.close() diff --git a/tests/test_api.py b/tests/test_api.py index dee09d3..8235868 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -30,6 +30,8 @@ async def test_api(self, request, httpx_mock): httpx_mock.add_response(json=request.cls.info) r = await _Api()._call("") # pylint: disable=protected-access assert r.json() == request.cls.info + + httpx_mock.add_response(json=request.cls.info) client = AsyncClient() r = await _Api(client)._call("") # pylint: disable=protected-access await client.aclose() From 79a831339a911d0d84f170a6b558d93b0d133cba Mon Sep 17 00:00:00 2001 From: Guido Schmitz Date: Fri, 29 Nov 2024 08:18:56 +0100 Subject: [PATCH 2/2] Add Python 3.13 to tests --- .github/workflows/pythonpackage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index 0702a47..e2c07ba 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -49,7 +49,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] steps: - name: Checkout sources uses: actions/checkout@v4.1.7