diff options
Diffstat (limited to 'meta-python')
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 @@ | |||
| 1 | From 17850cde66d52a851a8a15a61f5c97311d30a296 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Sat, 26 Jul 2025 16:03:03 -0700 | ||
| 4 | Subject: [PATCH] Add asyncio fixture to test_instance_async_method_spy | ||
| 5 | |||
| 6 | This ensures that this test executes and passes | ||
| 7 | with pytest-8.4+ | ||
| 8 | |||
| 9 | pytest now throws errors for such functions [1] | ||
| 10 | which were skipped in older versions | ||
| 11 | |||
| 12 | [1] https://github.com/pytest-dev/pytest/issues/11372 | ||
| 13 | |||
| 14 | Upstream-Status: Submitted [https://github.com/pytest-dev/pytest-mock/pull/516] | ||
| 15 | Signed-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 | |||
| 20 | diff --git a/tests/test_pytest_mock.py b/tests/test_pytest_mock.py | ||
| 21 | index 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 | ||
| 8 | SRC_URI += " \ | 8 | SRC_URI += " \ |
| 9 | file://0001-Add-asyncio-fixture-to-test_instance_async_method_sp.patch \ | ||
| 9 | file://run-ptest \ | 10 | file://run-ptest \ |
| 10 | " | 11 | " |
| 11 | SRC_URI[sha256sum] = "159e9edac4c451ce77a5cdb9fc5d1100708d2dd4ba3c3df572f14097351af80e" | 12 | SRC_URI[sha256sum] = "159e9edac4c451ce77a5cdb9fc5d1100708d2dd4ba3c3df572f14097351af80e" |
