Accepting request 948117 from devel:languages:python:pytest

OBS-URL: https://build.opensuse.org/request/show/948117
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-pytest-mock?expand=0&rev=21
This commit is contained in:
Dominique Leuenberger 2022-01-23 15:25:41 +00:00 committed by Git OBS Bridge
commit dd2704d14b
3 changed files with 61 additions and 7 deletions

View File

@ -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*")

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Sat Jan 22 11:58:55 UTC 2022 - Ben Greiner <code@bnavigator.de>
- Add pytest-mock-issue272-asyncio.patch
* gh#pytest-dev/pytest-mock#272
------------------------------------------------------------------- -------------------------------------------------------------------
Thu Jun 3 09:35:04 UTC 2021 - Antonio Larrosa <alarrosa@suse.com> Thu Jun 3 09:35:04 UTC 2021 - Antonio Larrosa <alarrosa@suse.com>

View File

@ -1,7 +1,7 @@
# #
# spec file for package python-pytest-mock # 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 # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # 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 %define skip_python2 1
Name: python-pytest-mock Name: python-pytest-mock
Version: 3.6.1 Version: 3.6.1
@ -25,6 +25,8 @@ Summary: Thin-wrapper around the mock package for easier use with pytest
License: MIT License: MIT
URL: https://github.com/pytest-dev/pytest-mock URL: https://github.com/pytest-dev/pytest-mock
Source: https://files.pythonhosted.org/packages/source/p/pytest-mock/pytest-mock-%{version}.tar.gz 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 >= 5}
BuildRequires: %{python_module pytest-asyncio} BuildRequires: %{python_module pytest-asyncio}
BuildRequires: %{python_module setuptools >= 36} BuildRequires: %{python_module setuptools >= 36}
@ -37,12 +39,11 @@ BuildArch: noarch
%description %description
This plugin installs a ``mocker`` fixture which is a thin-wrapper around the patching API This plugin installs a ``mocker`` fixture which is a thin-wrapper around the patching API
provided by the `mock` package, provided by the `mock` package, but with the benefit of not having to worry about undoing
but with the benefit of not having to worry about undoing patches at the end patches at the end of a test
of a test
%prep %prep
%setup -q -n pytest-mock-%{version} %autosetup -p1 -n pytest-mock-%{version}
%build %build
%python_build %python_build
@ -57,6 +58,7 @@ of a test
%files %{python_files} %files %{python_files}
%doc CHANGELOG.rst %doc CHANGELOG.rst
%license LICENSE %license LICENSE
%{python_sitelib}/* %{python_sitelib}/pytest_mock
%{python_sitelib}/pytest_mock-%{version}*-info
%changelog %changelog