diff --git a/.python-pytest-cov.metadata b/.python-pytest-cov.metadata new file mode 100644 index 0000000..47240e3 --- /dev/null +++ b/.python-pytest-cov.metadata @@ -0,0 +1 @@ +e077203b376dc922fd5dfd0da79cd68304624b16 SOURCES/pytest-cov-4.0.0.tar.gz diff --git a/SOURCES/0001-fix-for-failing-tests-with-coverage-5.4.patch b/SOURCES/0001-fix-for-failing-tests-with-coverage-5.4.patch new file mode 100644 index 0000000..239ba15 --- /dev/null +++ b/SOURCES/0001-fix-for-failing-tests-with-coverage-5.4.patch @@ -0,0 +1,43 @@ +From 92ad6f411167dc05bf54beeb5d9ebc916cc0f6f3 Mon Sep 17 00:00:00 2001 +From: chedi +Date: Fri, 29 Jan 2021 18:48:58 +0100 +Subject: [PATCH] fix for failing tests with coverage 5.4 + +--- + tests/test_pytest_cov.py | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/tests/test_pytest_cov.py b/tests/test_pytest_cov.py +index 3c73050..ff22fef 100644 +--- a/tests/test_pytest_cov.py ++++ b/tests/test_pytest_cov.py +@@ -500,7 +500,7 @@ def test_central_coveragerc(testdir, prop): + ]) + + # single-module coverage report +- assert all(not line.startswith('TOTAL ') for line in result.stdout.lines[-4:]) ++ assert all(not line.startswith('TOTAL ') for line in result.stdout.lines[-3:]) + + assert result.ret == 0 + +@@ -538,7 +538,7 @@ parallel = true + ]) + + # single-module coverage report +- assert all(not line.startswith('TOTAL ') for line in result.stdout.lines[-4:]) ++ assert all(not line.startswith('TOTAL ') for line in result.stdout.lines[-3:]) + + assert result.ret == 0 + +@@ -643,7 +643,7 @@ show_missing = true + ]) + + # single-module coverage report +- assert all(not line.startswith('TOTAL ') for line in result.stdout.lines[-4:]) ++ assert all(not line.startswith('TOTAL ') for line in result.stdout.lines[-3:]) + + assert result.ret == 0 + +-- +2.29.2 + diff --git a/SOURCES/0001_disabling_boxed_xdist_test.patch b/SOURCES/0001_disabling_boxed_xdist_test.patch new file mode 100644 index 0000000..e8903d3 --- /dev/null +++ b/SOURCES/0001_disabling_boxed_xdist_test.patch @@ -0,0 +1,14 @@ +--- a/tests/test_pytest_cov.py 2022-11-11 21:00:59.063033789 +0100 ++++ b/tests/test_pytest_cov.py 2022-11-11 21:22:22.097947660 +0100 +@@ -1554,8 +1554,9 @@ + ''' + + SCRIPT_SIMPLE_RESULT = '4 * 100%' +- +- ++ ++@pytest.mark.skipif('tuple(map(int, xdist.__version__.split("."))) >= (2, 5, 0)', ++ reason="--boxed option was removed in version 2.5.0") + @pytest.mark.skipif('sys.platform == "win32"') + def test_dist_boxed(testdir): + script = testdir.makepyfile(SCRIPT_SIMPLE) diff --git a/SOURCES/32d8c0665ea044f9682a89633d75442d1a4d2dc4.patch b/SOURCES/32d8c0665ea044f9682a89633d75442d1a4d2dc4.patch new file mode 100644 index 0000000..b9c9647 --- /dev/null +++ b/SOURCES/32d8c0665ea044f9682a89633d75442d1a4d2dc4.patch @@ -0,0 +1,39 @@ +From 32d8c0665ea044f9682a89633d75442d1a4d2dc4 Mon Sep 17 00:00:00 2001 +From: Ned Batchelder +Date: Thu, 5 Dec 2019 16:37:48 -0500 +Subject: [PATCH] Fix the context tests + +CoverageData.lines() returns a list, but in no guaranteed order. +Set-ify everything to get the correct comparison. +--- + tests/test_pytest_cov.py | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/tests/test_pytest_cov.py b/tests/test_pytest_cov.py +index e79e9aa..3be8278 100644 +--- a/tests/test_pytest_cov.py ++++ b/tests/test_pytest_cov.py +@@ -1934,12 +1934,12 @@ def test_cov_and_no_cov(testdir): + + + def find_labels(text, pattern): +- all_labels = collections.defaultdict(list) ++ all_labels = collections.defaultdict(set) + lines = text.splitlines() + for lineno, line in enumerate(lines, start=1): + labels = re.findall(pattern, line) + for label in labels: +- all_labels[label].append(lineno) ++ all_labels[label].add(lineno) + return all_labels + + +@@ -2007,7 +2007,7 @@ def test_contexts(testdir, opts): + if context == '': + continue + data.set_query_context(context) +- actual = data.lines(test_context_path) ++ actual = set(data.lines(test_context_path)) + assert line_data[label] == actual, "Wrong lines for context {!r}".format(context) + + diff --git a/SPECS/python-pytest-cov.spec b/SPECS/python-pytest-cov.spec new file mode 100644 index 0000000..a90068b --- /dev/null +++ b/SPECS/python-pytest-cov.spec @@ -0,0 +1,188 @@ +## START: Set by rpmautospec +## (rpmautospec version 0.3.0) +%define autorelease(e:s:pb:n) %{?-p:0.}%{lua: + release_number = 2; + base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); + print(release_number + base_release_number - 1); +}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} +## END: Set by rpmautospec + +%global srcname pytest-cov +%global slugname pytest_cov +%global forgeurl https://github.com/pytest-dev/%{srcname} + +%global common_description %{expand: +This plugin produces coverage reports. Compared to just using coverage run this +plugin does some extras: + + • Subprocess support: you can fork or run stuff in a subprocess and will get + covered without any fuss. + • Xdist support: you can use all of pytest-xdist’s features and still get + coverage. + • Consistent pytest behavior. If you run coverage run -m pytest you will have + slightly different sys.path (CWD will be in it, unlike when running + pytest). + +All features offered by the coverage package should work, either through +pytest-cov’s command line options or through coverage’s config file. +} + +# During python mass rebuild we need to build python-pytest-cov without +# tests because some dependencies are not yet available +%bcond_without tests + +Name: python-%{srcname} +Version: 4.0.0 +%forgemeta +Release: %autorelease +Summary: Coverage plugin for pytest +License: MIT +URL: %{forgeurl} +Source: %{forgesource} +Patch: 0001_disabling_boxed_xdist_test.patch +BuildArch: noarch +BuildRequires: python3-devel +BuildRequires: pyproject-rpm-macros + +%description %{common_description} + +%package -n python3-%{srcname} +Summary: %{summary} +%description -n python3-%{srcname} %{common_description} + +%prep +%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 +%pyproject_buildrequires -r %{?with_tests:-x testing} + +%build +%pyproject_wheel + +%install +%pyproject_install +%pyproject_save_files %{slugname} + +%if %{with tests} +%check +k="$(awk 'NR>1 {pre=" and " } { printf "%snot %s", pre, $0 }' < 4.0.0-2 +- fixing a pytest-xdist failing test due to the deprecation of the boxed + parameter (#2142008) + +* Thu Sep 29 2022 chedi toueiti 4.0.0-1 +- Update to version 4.0.0 (#2130722) + +* Fri Jul 22 2022 Fedora Release Engineering 3.0.0-11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Wed Jul 13 2022 chedi toueiti 3.0.0-10 +- minor formating update + +* Tue Jun 14 2022 Python Maint 3.0.0-9 +- Rebuilt for Python 3.11 + +* Mon Jun 13 2022 Python Maint 3.0.0-8 +- Bootstrap for Python 3.11 + +* Wed May 25 2022 Orion Poplawski 3.0.0-7 +- Re-enable tests + +* Thu May 19 2022 Tomáš Hrnčiar 3.0.0-6 +- Add bcond to disable tests + +* Fri Jan 21 2022 Fedora Release Engineering 3.0.0-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Thu Dec 09 2021 Tom spot Callaway 3.0.0-4 +- 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 + +* Wed Dec 08 2021 chedi 3.0.0-3 +- bumping release to force f36 rebuild + +* Wed Oct 13 2021 chedi 3.0.0-2 +- reverting to auto generated dependencies + +* Mon Oct 04 2021 chedi 3.0.0-1 +- Update to version 3.0.0 (#2010140) + +* Mon Aug 02 2021 Benjamin A. Beasley 2.12.1-1 +- Update to 2.12.1 (closes RHBZ#1960609) + +* Wed Jul 28 2021 Benjamin A. Beasley - 2.11.1-6 +- Drop obsolete macros +- Update description and summary from upstream +- Use “forge” macros to reference source +- Use pyproject-rpm-macros + +* Fri Jul 23 2021 Fedora Release Engineering - 2.11.1-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Wed Jun 02 2021 Python Maint - 2.11.1-4 +- Rebuilt for Python 3.10 + +* Fri Jan 29 2021 Chedi Toueiti - 2.11.1-3 +- Fix for failing tests with coverage 5.4 (#1922301) + +* Wed Jan 27 2021 Fedora Release Engineering - 2.11.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Wed Jan 20 2021 Chedi Toueiti - 2.11.1-1 +- Update to 2.11.1 (#1917248) + +* Fri Aug 14 2020 Chedi Toueiti - 2.10.1-1 +- Update to 2.10.1 (#1868968) + +* Wed Jul 29 2020 Fedora Release Engineering - 2.10.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Thu Jul 9 2020 Chedi Toueiti - 2.10.0 +- Update to 2.10.0 + +* Sun May 24 2020 Miro Hrončok - 2.8.1-6 +- Rebuilt for Python 3.9 + +* Mon Mar 2 2020 Chedi Toueiti - 2.8.1-5 +- Forcing current pytest-cov version usage during checks + +* Thu Jan 30 2020 Fedora Release Engineering - 2.8.1-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Sun Jan 19 2020 Lumír Balhar - 2.8.1-3 +- Unskip tests which are working with the newest coverage + +* Sun Nov 3 2019 Orion Poplawski - 2.8.1-2 +- Drop python 2 for F32+ (bz#1767517) + +* Sat Oct 5 2019 Orion Poplawski - 2.8.1-1 +- Update to 2.8.1 + +* Fri Oct 4 2019 Orion Poplawski - 2.8.0-1 +- Update to 2.8.0 + +* Thu Oct 03 2019 Miro Hrončok - 2.7.1-6 +- Rebuilt for Python 3.8.0rc1 (#1748018) +