summaryrefslogtreecommitdiffstats
path: root/meta-python
diff options
context:
space:
mode:
Diffstat (limited to 'meta-python')
-rw-r--r--meta-python/recipes-devtools/python/python3-pytest-mock/0001-Add-asyncio-fixture-to-test_instance_async_method_sp.patch32
-rw-r--r--meta-python/recipes-devtools/python/python3-pytest-mock_3.14.1.bb1
2 files changed, 33 insertions, 0 deletions
diff --git a/meta-python/recipes-devtools/python/python3-pytest-mock/0001-Add-asyncio-fixture-to-test_instance_async_method_sp.patch b/meta-python/recipes-devtools/python/python3-pytest-mock/0001-Add-asyncio-fixture-to-test_instance_async_method_sp.patch
new file mode 100644
index 0000000000..d57c51f880
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-pytest-mock/0001-Add-asyncio-fixture-to-test_instance_async_method_sp.patch
@@ -0,0 +1,32 @@
1From 17850cde66d52a851a8a15a61f5c97311d30a296 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 26 Jul 2025 16:03:03 -0700
4Subject: [PATCH] Add asyncio fixture to test_instance_async_method_spy
5
6This ensures that this test executes and passes
7with pytest-8.4+
8
9pytest now throws errors for such functions [1]
10which were skipped in older versions
11
12[1] https://github.com/pytest-dev/pytest/issues/11372
13
14Upstream-Status: Submitted [https://github.com/pytest-dev/pytest-mock/pull/516]
15Signed-off-by: Khem Raj <raj.khem@gmail.com>
16---
17 tests/test_pytest_mock.py | 2 +-
18 1 file changed, 1 insertion(+), 1 deletion(-)
19
20diff --git a/tests/test_pytest_mock.py b/tests/test_pytest_mock.py
21index 1a51636..b158d97 100644
22--- a/tests/test_pytest_mock.py
23+++ b/tests/test_pytest_mock.py
24@@ -523,7 +523,7 @@ def test_callable_like_spy(testdir: Any, mocker: MockerFixture) -> None:
25 assert spy.spy_return == 20
26 assert spy.spy_return_list == [20]
27
28-
29+@pytest.mark.asyncio
30 async def test_instance_async_method_spy(mocker: MockerFixture) -> None:
31 class Foo:
32 async def bar(self, arg):
diff --git a/meta-python/recipes-devtools/python/python3-pytest-mock_3.14.1.bb b/meta-python/recipes-devtools/python/python3-pytest-mock_3.14.1.bb
index 775b77ccc2..f107e20ff5 100644
--- a/meta-python/recipes-devtools/python/python3-pytest-mock_3.14.1.bb
+++ b/meta-python/recipes-devtools/python/python3-pytest-mock_3.14.1.bb
@@ -6,6 +6,7 @@ LIC_FILES_CHKSUM = " \
6" 6"
7 7
8SRC_URI += " \ 8SRC_URI += " \
9 file://0001-Add-asyncio-fixture-to-test_instance_async_method_sp.patch \
9 file://run-ptest \ 10 file://run-ptest \
10" 11"
11SRC_URI[sha256sum] = "159e9edac4c451ce77a5cdb9fc5d1100708d2dd4ba3c3df572f14097351af80e" 12SRC_URI[sha256sum] = "159e9edac4c451ce77a5cdb9fc5d1100708d2dd4ba3c3df572f14097351af80e"