14
0
Files
python-responses/use-asyncio-markers.patch

75 lines
2.2 KiB
Diff
Raw Normal View History

From 685d75afa091a5e1eaf7a2b008f6edf46a03301d Mon Sep 17 00:00:00 2001
From: Mark Story <mark@mark-story.com>
Date: Wed, 14 Feb 2024 15:15:05 -0500
Subject: [PATCH 1/2] Use pytest.mark.asyncio
This resolved async test failures locally.
Refs #706
---
responses/tests/test_registries.py | 1 +
responses/tests/test_responses.py | 1 +
2 files changed, 2 insertions(+)
diff --git a/responses/tests/test_registries.py b/responses/tests/test_registries.py
index 2ab035b1..97fd07fb 100644
--- a/responses/tests/test_registries.py
+++ b/responses/tests/test_registries.py
@@ -63,6 +63,7 @@ def run_with_registry():
assert_reset()
+@pytest.mark.asyncio
async def test_registry_async():
class CustomRegistry(registries.FirstMatchRegistry):
pass
diff --git a/responses/tests/test_responses.py b/responses/tests/test_responses.py
index e074f6a9..98537fe9 100644
--- a/responses/tests/test_responses.py
+++ b/responses/tests/test_responses.py
@@ -2263,6 +2263,7 @@ def run():
assert_reset()
+@pytest.mark.asyncio
async def test_async_calls():
@responses.activate
async def run():
From 790646dd1df11ff7c51655c2a6193000d888e66d Mon Sep 17 00:00:00 2001
From: Mark Story <mark@mark-story.com>
Date: Wed, 14 Feb 2024 16:16:00 -0500
Subject: [PATCH 2/2] Add type ignores
---
responses/tests/test_registries.py | 2 +-
responses/tests/test_responses.py | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/responses/tests/test_registries.py b/responses/tests/test_registries.py
index 97fd07fb..c2c90d97 100644
--- a/responses/tests/test_registries.py
+++ b/responses/tests/test_registries.py
@@ -64,7 +64,7 @@ def run_with_registry():
@pytest.mark.asyncio
-async def test_registry_async():
+async def test_registry_async(): # type: ignore[misc]
class CustomRegistry(registries.FirstMatchRegistry):
pass
diff --git a/responses/tests/test_responses.py b/responses/tests/test_responses.py
index 98537fe9..12176b92 100644
--- a/responses/tests/test_responses.py
+++ b/responses/tests/test_responses.py
@@ -2264,7 +2264,7 @@ def run():
@pytest.mark.asyncio
-async def test_async_calls():
+async def test_async_calls(): # type: ignore[misc]
@responses.activate
async def run():
responses.add(