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 90bd22d..82de41a 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 @@ -10,6 +13,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,18 +46,13 @@ 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 %generate_buildrequires - -%if 0%{?rhel} >= 9 -%pyproject_buildrequires -%else -%pyproject_buildrequires -x testing -%endif +%pyproject_buildrequires -r %{?with_tests:-x testing} %build @@ -64,9 +64,8 @@ sed -r -i '/^[[:blank:]]*.hunter.,[[:blank:]]*$/d' setup.py %pyproject_save_files pytest_cov -%if 0%{?rhel} >= 9 -echo "disabling tests in epel until all the dependencies are satisfied" -%else + +%if %{with tests} %check k="$(awk 'NR>1 {pre=" and " } { printf "%snot %s", pre, $0 }' <