diff --git a/pytest-mock-issue272-asyncio.patch b/pytest-mock-issue272-asyncio.patch new file mode 100644 index 0000000..494c290 --- /dev/null +++ b/pytest-mock-issue272-asyncio.patch @@ -0,0 +1,46 @@ +Index: pytest-mock-3.6.1/tests/test_pytest_mock.py +=================================================================== +--- pytest-mock-3.6.1.orig/tests/test_pytest_mock.py ++++ pytest-mock-3.6.1/tests/test_pytest_mock.py +@@ -839,7 +839,7 @@ def test_plain_stopall(testdir: Any) -> + """ + ) + result = testdir.runpytest_subprocess() +- result.stdout.fnmatch_lines("* 1 passed in *") ++ result.stdout.fnmatch_lines("* 1 passed*") + assert "RuntimeError" not in result.stderr.str() + + +@@ -978,7 +978,7 @@ def test_used_with_class_scope(testdir: + ) + result = testdir.runpytest_subprocess() + assert "AssertionError" not in result.stderr.str() +- result.stdout.fnmatch_lines("* 1 passed in *") ++ result.stdout.fnmatch_lines("* 1 passed*") + + + def test_used_with_module_scope(testdir: Any) -> None: +@@ -1000,7 +1000,7 @@ def test_used_with_module_scope(testdir: + ) + result = testdir.runpytest_subprocess() + assert "AssertionError" not in result.stderr.str() +- result.stdout.fnmatch_lines("* 1 passed in *") ++ result.stdout.fnmatch_lines("* 1 passed*") + + + def test_used_with_package_scope(testdir: Any) -> None: +@@ -1023,7 +1023,7 @@ def test_used_with_package_scope(testdir + ) + result = testdir.runpytest_subprocess() + assert "AssertionError" not in result.stderr.str() +- result.stdout.fnmatch_lines("* 1 passed in *") ++ result.stdout.fnmatch_lines("* 1 passed*") + + + def test_used_with_session_scope(testdir: Any) -> None: +@@ -1046,4 +1046,4 @@ def test_used_with_session_scope(testdir + ) + result = testdir.runpytest_subprocess() + assert "AssertionError" not in result.stderr.str() +- result.stdout.fnmatch_lines("* 1 passed in *") ++ result.stdout.fnmatch_lines("* 1 passed*") diff --git a/python-pytest-mock.changes b/python-pytest-mock.changes index e72265f..5b82bb9 100644 --- a/python-pytest-mock.changes +++ b/python-pytest-mock.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Sat Jan 22 11:58:55 UTC 2022 - Ben Greiner + +- Add pytest-mock-issue272-asyncio.patch + * gh#pytest-dev/pytest-mock#272 + ------------------------------------------------------------------- Thu Jun 3 09:35:04 UTC 2021 - Antonio Larrosa diff --git a/python-pytest-mock.spec b/python-pytest-mock.spec index d2703fd..a3e21de 100644 --- a/python-pytest-mock.spec +++ b/python-pytest-mock.spec @@ -1,7 +1,7 @@ # # spec file for package python-pytest-mock # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,7 +16,7 @@ # -%{?!python_module:%define python_module() python-%{**} python3-%{**}} +%{?!python_module:%define python_module() python3-%{**}} %define skip_python2 1 Name: python-pytest-mock Version: 3.6.1 @@ -25,6 +25,8 @@ Summary: Thin-wrapper around the mock package for easier use with pytest License: MIT URL: https://github.com/pytest-dev/pytest-mock Source: https://files.pythonhosted.org/packages/source/p/pytest-mock/pytest-mock-%{version}.tar.gz +# PATCH-FIX-UPSTREAM pytest-mock-issue272-asyncio.patch -- gh#pytest-dev/pytest-mock#272 +Patch0: pytest-mock-issue272-asyncio.patch BuildRequires: %{python_module pytest >= 5} BuildRequires: %{python_module pytest-asyncio} BuildRequires: %{python_module setuptools >= 36} @@ -37,12 +39,11 @@ BuildArch: noarch %description This plugin installs a ``mocker`` fixture which is a thin-wrapper around the patching API -provided by the `mock` package, -but with the benefit of not having to worry about undoing patches at the end -of a test +provided by the `mock` package, but with the benefit of not having to worry about undoing +patches at the end of a test %prep -%setup -q -n pytest-mock-%{version} +%autosetup -p1 -n pytest-mock-%{version} %build %python_build @@ -57,6 +58,7 @@ of a test %files %{python_files} %doc CHANGELOG.rst %license LICENSE -%{python_sitelib}/* +%{python_sitelib}/pytest_mock +%{python_sitelib}/pytest_mock-%{version}*-info %changelog