From e8988c1b79d14abee9b026c2f47f8697406704a596afa9f0d2e41db860b6ada8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=C3=A9ta=20Machov=C3=A1?= Date: Fri, 15 Jan 2021 12:17:00 +0000 Subject: [PATCH] Accepting request 863329 from home:mcalabkova:branches:devel:languages:python:pytest - Add pytest62.patch to make testsuite compatible with new pytest OBS-URL: https://build.opensuse.org/request/show/863329 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:pytest/python-pytest-cov?expand=0&rev=22 --- pytest62.patch | 31 +++++++++++++++++++++++++++++++ python-pytest-cov.changes | 5 +++++ python-pytest-cov.spec | 5 ++++- 3 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 pytest62.patch diff --git a/pytest62.patch b/pytest62.patch new file mode 100644 index 0000000..11b31f0 --- /dev/null +++ b/pytest62.patch @@ -0,0 +1,31 @@ +From 25eed212085ce9a2d5383a6a4a2b360d0d514f89 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ionel=20Cristian=20M=C4=83rie=C8=99?= +Date: Mon, 11 Jan 2021 15:49:18 +0200 +Subject: [PATCH] Turns out there were some internal changes in the pytester + plugin. + +--- + tests/test_pytest_cov.py | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +diff --git a/tests/test_pytest_cov.py b/tests/test_pytest_cov.py +index f0fd6ca..c6511aa 100644 +--- a/tests/test_pytest_cov.py ++++ b/tests/test_pytest_cov.py +@@ -1538,8 +1538,14 @@ def test_cover_looponfail(testdir, monkeypatch): + testdir.makeconftest(CONFTEST) + script = testdir.makepyfile(BASIC_TEST) + +- monkeypatch.setattr(testdir, 'run', +- lambda *args, **kwargs: _TestProcess(*map(str, args))) ++ def mock_run(*args, **kwargs): ++ return _TestProcess(*map(str, args)) ++ ++ monkeypatch.setattr(testdir, 'run', mock_run) ++ assert testdir.run is mock_run ++ if hasattr(testdir, '_pytester'): ++ monkeypatch.setattr(testdir._pytester, 'run', mock_run) ++ assert testdir._pytester.run is mock_run + with testdir.runpytest('-v', + '--cov=%s' % script.dirpath(), + '--looponfail', diff --git a/python-pytest-cov.changes b/python-pytest-cov.changes index b19cc1b..52bcc7e 100644 --- a/python-pytest-cov.changes +++ b/python-pytest-cov.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri Jan 15 11:59:34 UTC 2021 - Markéta Machová + +- Add pytest62.patch to make testsuite compatible with new pytest + ------------------------------------------------------------------- Fri Aug 21 14:16:07 UTC 2020 - Marketa Calabkova diff --git a/python-pytest-cov.spec b/python-pytest-cov.spec index 6dca5e5..97df398 100644 --- a/python-pytest-cov.spec +++ b/python-pytest-cov.spec @@ -1,7 +1,7 @@ # # spec file for package python-pytest-cov # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -24,6 +24,8 @@ Summary: Pytest plugin for coverage reporting License: MIT URL: https://github.com/schlamar/pytest-cov Source: https://files.pythonhosted.org/packages/source/p/pytest-cov/pytest-cov-%{version}.tar.gz +# PATCH-FIX-UPSTREAM https://github.com/pytest-dev/pytest-cov/commit/25eed212085ce9a2d5383a6a4a2b360d0d514f89 Turns out there were some internal changes in the pytester plugin. +Patch0: pytest62.patch BuildRequires: %{python_module coverage >= 4.4} BuildRequires: %{python_module fields} BuildRequires: %{python_module process-tests} @@ -49,6 +51,7 @@ through pytest-cov or through coverage's config file. %prep %setup -q -n pytest-cov-%{version} +%patch0 -p1 %build %python_build