From 8e9e21129ab3af879e55e0c3e02f05b5623626d4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 30 May 2026 05:12:50 +0000 Subject: [PATCH 1/3] Bump pytest-asyncio from 1.3.0 to 1.4.0 Bumps [pytest-asyncio](https://github.com/pytest-dev/pytest-asyncio) from 1.3.0 to 1.4.0. - [Release notes](https://github.com/pytest-dev/pytest-asyncio/releases) - [Commits](https://github.com/pytest-dev/pytest-asyncio/compare/v1.3.0...v1.4.0) --- updated-dependencies: - dependency-name: pytest-asyncio dependency-version: 1.4.0 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- uv.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/uv.lock b/uv.lock index 2ecf877..87a69f0 100644 --- a/uv.lock +++ b/uv.lock @@ -778,16 +778,16 @@ wheels = [ [[package]] name = "pytest-asyncio" -version = "1.3.0" +version = "1.4.0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "backports-asyncio-runner", marker = "python_full_version < '3.11'" }, { name = "pytest" }, { name = "typing-extensions", marker = "python_full_version < '3.13'" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/90/2c/8af215c0f776415f3590cac4f9086ccefd6fd463befeae41cd4d3f193e5a/pytest_asyncio-1.3.0.tar.gz", hash = "sha256:d7f52f36d231b80ee124cd216ffb19369aa168fc10095013c6b014a34d3ee9e5", size = 50087, upload-time = "2025-11-10T16:07:47.256Z" } +sdist = { url = "https://files.pythonhosted.org/packages/43/7c/d36d04db312ecf4298932ef77e6e4a9e8ad017906e24e34f0b0c361a2473/pytest_asyncio-1.4.0.tar.gz", hash = "sha256:c6c0d2259945122819f171a32ecea2c349ead889ee28176caaf492143424be42", size = 58514, upload-time = "2026-05-26T09:56:04.083Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/e5/35/f8b19922b6a25bc0880171a2f1a003eaeb93657475193ab516fd87cac9da/pytest_asyncio-1.3.0-py3-none-any.whl", hash = "sha256:611e26147c7f77640e6d0a92a38ed17c3e9848063698d5c93d5aa7aa11cebff5", size = 15075, upload-time = "2025-11-10T16:07:45.537Z" }, + { url = "https://files.pythonhosted.org/packages/03/e2/08a497ef684b88559c9cc5f4ad53a37e7b99e727094a86d6ea32536d5d3c/pytest_asyncio-1.4.0-py3-none-any.whl", hash = "sha256:933ca923a23075a87fb7070c0ec272a6848489824d887c85c812670932835aa1", size = 16930, upload-time = "2026-05-26T09:56:02.576Z" }, ] [[package]] From a6d70e2a1d2693e585db97d48c05dd79db418115 Mon Sep 17 00:00:00 2001 From: Justin Walters Date: Wed, 24 Jun 2026 10:46:40 -0700 Subject: [PATCH 2/3] update tests after pytest-asyncio removed implicit event loop --- tests/test_basic.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tests/test_basic.py b/tests/test_basic.py index 0bf8c4c..9749752 100644 --- a/tests/test_basic.py +++ b/tests/test_basic.py @@ -108,6 +108,23 @@ setup_logging(TEST_CONFIG["LOG"]) +@pytest.fixture +def current_event_loop(): + """ + Provide a current event loop on the main thread for synchronous tests that + drive the loop themselves (e.g. they call ``shark.start()`` directly). + + pytest-asyncio no longer sets a current event loop, and + ``asyncio.get_event_loop()`` no longer creates one implicitly, so these + tests need an explicit loop set up and torn down around them. + """ + loop = asyncio.new_event_loop() + asyncio.set_event_loop(loop) + yield loop + loop.close() + asyncio.set_event_loop(None) + + class aioresponses_delayed(aioresponses): # noqa """ Just like aioresponses, but slightly delays POST requests. @@ -134,6 +151,7 @@ async def close(self): await self.session.on_close() +@pytest.mark.usefixtures("current_event_loop") class TestShark: def test_shark_init(self): shark = SocketShark(TEST_CONFIG) @@ -2522,6 +2540,7 @@ async def dummy_send(*args): await shark.shutdown() +@pytest.mark.usefixtures("current_event_loop") class TestWebsocket: """ Test an actual WebSocket connection. From 89275b8cd7d4db11a003f7b92567cc7dc9041e3c Mon Sep 17 00:00:00 2001 From: Justin Walters Date: Wed, 24 Jun 2026 15:23:21 -0700 Subject: [PATCH 3/3] remove unnecessary docstring --- tests/test_basic.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/tests/test_basic.py b/tests/test_basic.py index 9749752..3d1bb0f 100644 --- a/tests/test_basic.py +++ b/tests/test_basic.py @@ -110,14 +110,6 @@ @pytest.fixture def current_event_loop(): - """ - Provide a current event loop on the main thread for synchronous tests that - drive the loop themselves (e.g. they call ``shark.start()`` directly). - - pytest-asyncio no longer sets a current event loop, and - ``asyncio.get_event_loop()`` no longer creates one implicitly, so these - tests need an explicit loop set up and torn down around them. - """ loop = asyncio.new_event_loop() asyncio.set_event_loop(loop) yield loop