From 103718b41f3802afa5a39c96c817bc670f5c421d Mon Sep 17 00:00:00 2001 From: Tom spot Callaway Date: Thu, 9 Dec 2021 14:18:08 -0500 Subject: [PATCH 1/3] Fix issue with test code where it expected too specific of a string, that string changed slightly with coverage 6.2, fix adjusts string check to be more permissive and work with both old and new coverage --- pytest-cov-3.0.0-coverage-6.2.patch | 12 ++++++++++++ python-pytest-cov.spec | 4 +++- 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 pytest-cov-3.0.0-coverage-6.2.patch diff --git a/pytest-cov-3.0.0-coverage-6.2.patch b/pytest-cov-3.0.0-coverage-6.2.patch new file mode 100644 index 0000000..c7c1a55 --- /dev/null +++ b/pytest-cov-3.0.0-coverage-6.2.patch @@ -0,0 +1,12 @@ +diff -up pytest-cov-3.0.0/tests/test_pytest_cov.py.cov62 pytest-cov-3.0.0/tests/test_pytest_cov.py +--- pytest-cov-3.0.0/tests/test_pytest_cov.py.cov62 2021-12-09 13:54:38.736407865 -0500 ++++ pytest-cov-3.0.0/tests/test_pytest_cov.py 2021-12-09 13:54:41.432423997 -0500 +@@ -968,7 +968,7 @@ def test_invalid_coverage_source(testdir + '*10 passed*' + ]) + result.stderr.fnmatch_lines([ +- 'Coverage.py warning: No data was collected.*' ++ '*No data was collected.*' + ]) + result.stdout.fnmatch_lines([ + '*Failed to generate report: No data to report.', diff --git a/python-pytest-cov.spec b/python-pytest-cov.spec index decbdaf..b973eeb 100644 --- a/python-pytest-cov.spec +++ b/python-pytest-cov.spec @@ -10,6 +10,8 @@ Summary: Coverage plugin for pytest License: MIT URL: %{forgeurl} Source0: %{forgesource} +# This fix adjusts the coverage test strings to work with 6.2, but they also work with older coverage versions as well. +Patch0: pytest-cov-3.0.0-coverage-6.2.patch BuildArch: noarch @@ -41,7 +43,7 @@ Summary: %{summary} %prep -%forgeautosetup +%forgeautosetup -p1 # The “hunter” testing dependency (https://github.com/ionelmc/python-hunter) is # not packaged, but it also does not seem to be used. sed -r -i '/^[[:blank:]]*.hunter.,[[:blank:]]*$/d' setup.py From b5c078b54da9ff6af7b7a1fc50bff3d3352b1790 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Hrn=C4=8Diar?= Date: Thu, 19 May 2022 15:33:38 +0200 Subject: [PATCH 3/3] Add bcond to disable tests --- python-pytest-cov.spec | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/python-pytest-cov.spec b/python-pytest-cov.spec index b973eeb..92b9cde 100644 --- a/python-pytest-cov.spec +++ b/python-pytest-cov.spec @@ -1,6 +1,9 @@ %global srcname pytest-cov %global forgeurl https://github.com/pytest-dev/%{srcname} +# During python mass rebuild we need to build python-pytest-cov without tests because some dependencies are not yet available +%bcond_with tests + Name: python-%{srcname} Version: 3.0.0 %forgemeta @@ -49,7 +52,7 @@ Summary: %{summary} sed -r -i '/^[[:blank:]]*.hunter.,[[:blank:]]*$/d' setup.py %generate_buildrequires -%pyproject_buildrequires -x testing +%pyproject_buildrequires -r %{?with_tests:-x testing} %build @@ -61,6 +64,7 @@ sed -r -i '/^[[:blank:]]*.hunter.,[[:blank:]]*$/d' setup.py %pyproject_save_files pytest_cov +%if %{with tests} %check k="$(awk 'NR>1 {pre=" and " } { printf "%snot %s", pre, $0 }' <