From d11c4d28c35ccf1e1a1cbe2f98cd8c5b85cbe1fbc977bf7fae52be0d93e22cf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=C3=A9ta=20Machov=C3=A1?= Date: Mon, 13 Oct 2025 15:45:49 +0000 Subject: [PATCH] - Add 0001-match-coverage-7.10.7-warnings.patch to fix tests OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:pytest/python-pytest-cov?expand=0&rev=55 --- .gitattributes | 23 ++ .gitignore | 1 + 0001-match-coverage-7.10.7-warnings.patch | 27 ++ _multibuild | 3 + pytest_cov-7.0.0.tar.gz | 3 + python-pytest-cov.changes | 344 ++++++++++++++++++++++ python-pytest-cov.spec | 102 +++++++ 7 files changed, 503 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 0001-match-coverage-7.10.7-warnings.patch create mode 100644 _multibuild create mode 100644 pytest_cov-7.0.0.tar.gz create mode 100644 python-pytest-cov.changes create mode 100644 python-pytest-cov.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/0001-match-coverage-7.10.7-warnings.patch b/0001-match-coverage-7.10.7-warnings.patch new file mode 100644 index 0000000..e81cc73 --- /dev/null +++ b/0001-match-coverage-7.10.7-warnings.patch @@ -0,0 +1,27 @@ +From b4fb003e3b6634cfc0db07aaf1e29cf6a94f037a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Mark=C3=A9ta=20Machov=C3=A1?= +Date: Mon, 13 Oct 2025 16:12:57 +0200 +Subject: [PATCH] match coverage 7.10.7 warnings + +--- + tests/test_pytest_cov.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/tests/test_pytest_cov.py b/tests/test_pytest_cov.py +index 6ca09fe..c71d776 100644 +--- a/tests/test_pytest_cov.py ++++ b/tests/test_pytest_cov.py +@@ -1435,8 +1435,8 @@ def test_filterwarnings_error(testdir): + result.stdout.fnmatch_lines(['* 1 passed *']) + result.stderr.fnmatch_lines( + [ +- '* (module-not-measured)', +- '* (no-data-collected)', ++ '* (module-not-measured)*', ++ '* (no-data-collected)*', + '* CovReportWarning: Failed to generate report: No data to report.', + ] + ) +-- +2.51.0 + diff --git a/_multibuild b/_multibuild new file mode 100644 index 0000000..fcc7b97 --- /dev/null +++ b/_multibuild @@ -0,0 +1,3 @@ + + test + diff --git a/pytest_cov-7.0.0.tar.gz b/pytest_cov-7.0.0.tar.gz new file mode 100644 index 0000000..afd151f --- /dev/null +++ b/pytest_cov-7.0.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:33c97eda2e049a0c5298e91f519302a1334c26ac65c1a483d6206fd458361af1 +size 54328 diff --git a/python-pytest-cov.changes b/python-pytest-cov.changes new file mode 100644 index 0000000..cf34761 --- /dev/null +++ b/python-pytest-cov.changes @@ -0,0 +1,344 @@ +------------------------------------------------------------------- +Mon Oct 13 14:15:34 UTC 2025 - Markéta Machová + +- Add 0001-match-coverage-7.10.7-warnings.patch to fix tests + +------------------------------------------------------------------- +Fri Sep 19 08:43:55 UTC 2025 - Markéta Machová + +- Skip tests failing with Python 3.14 + +------------------------------------------------------------------- +Tue Sep 16 02:43:29 UTC 2025 - Steve Kowalik + +- Update to 7.0.0: + * Dropped support for subprocesses measurement. + * Switched packaging to have metadata completely in pyproject.toml and use + hatchling for building. + +------------------------------------------------------------------- +Wed Jul 2 02:18:36 UTC 2025 - Steve Kowalik + +- Update to 6.2.1: + * Added a version requirement for pytest's pluggy dependency. + * Removed deprecated license classifier (packaging). + * The plugin now adds 3 rules in the filter warnings configuration to + prevent common coverage warnings being raised as obscure errors. + * Fixed breakage that occurs when ``--cov-context`` and the ``no_cover`` + marker are used together. + * Change terminal output to use full width lines for the coverage header. + * Removed unnecessary CovFailUnderWarning. + * Fixed the term report not using the precision specified via + ``--cov-precision``. + * Changed fail under checks to use the precision set in the coverage + configuration. + * Added a ``--cov-precision`` cli option that can override the value set + in your coverage configuration. + * Dropped support for now EOL Python 3.8. +- Drop patch support-coverage-75.patch, included upstream. + +------------------------------------------------------------------- +Wed May 15 04:22:31 UTC 2024 - Steve Kowalik + +- Switch to pytest macro. +- Add patch support-coverage-75.patch: + * Support changes in coverage 7.5. + +------------------------------------------------------------------- +Mon Mar 25 15:17:56 UTC 2024 - Dirk Müller + +- update to 5.0.0: + * Removed support for xdist rsync (now deprecated). + * Switched docs theme to Furo. + * Various legacy Python cleanup and CI improvements. + Contributed by Christian Clauss and Hugo van Kemenade in + #630, #631, #632 and #633. + * Added a pyproject.toml example in the docs. Contributed by + Dawn James in #626. + * Modernized project's pre-commit hooks to use ruff. Initial + POC contributed by Christian Clauss in #584. + +------------------------------------------------------------------- +Thu Jun 1 08:51:00 UTC 2023 - Dirk Müller + +- update to 4.1.0: + * Updated CI with new Pythons and dependencies. + * Removed rsyncdir support. This makes pytest-cov compatible + with xdist 3.0. + * Added support for JSON reporting. + * Refactored code to use f-strings. + * Fixed a skip in the test suite for some old xdist. + +------------------------------------------------------------------- +Fri Apr 21 12:31:31 UTC 2023 - Dirk Müller + +- add sle15_python_module_pythons (jsc#PED-68) + +------------------------------------------------------------------- +Thu Apr 13 22:44:00 UTC 2023 - Matej Cepl + +- Make calling of %{sle15modernpython} optional. + +------------------------------------------------------------------- +Thu Dec 8 10:28:35 UTC 2022 - pgajdos@suse.com + +- six is not required for build + +------------------------------------------------------------------- +Wed Nov 30 08:16:55 UTC 2022 - Daniel Garcia + +- Disable test_dist_boxed, broken with latest version of pytest-xdist, + gh#pytest-dev/pytest-cov#565 + +------------------------------------------------------------------- +Mon Nov 28 09:31:24 UTC 2022 - Daniel Garcia + +- Disable failing tests (test_contexts) that fails because of the new version + of python-coverage, gh#pytest-dev/pytest-cov#570 + +------------------------------------------------------------------- +Fri Nov 25 11:55:18 UTC 2022 - Daniel Garcia + +- Remove support-coverage-62.patch +- Remove support-setuptools60.patch +- Update to 4.0.0: + * --cov-fail-under no longer causes pytest --collect-only to fail Contributed + by Zac Hatfield-Dodds in #511. + * Dropped support for multiprocessing (mostly because issue 82408). This + feature was mostly working but very broken in certain scenarios and made + the test suite very flaky and slow. + * There is builtin multiprocessing support in coverage and you can migrate to + that. All you need is this in your .coveragerc: + + [run] + concurrency = multiprocessing + parallel = true + sigterm = true + + * Fixed deprecation in setup.py by trying to import setuptools before + distutils. Contributed by Ben Greiner in #545. + * Removed undesirable new lines that were displayed while reporting was + disabled. Contributed by Delgan in #540. + * Documentation fixes. Contributed by Andre Brisco in #543 and Colin O'Dell + in #525. + * Added support for LCOV output format via --cov-report=lcov. Only works with + coverage 6.3+. Contributed by Christian Fetzer in #536. + * Modernized pytest hook implementation. Contributed by Bruno Oliveira in + #549 and Ronny Pfannschmidt in #550. + +------------------------------------------------------------------- +Sun Jul 17 20:14:59 UTC 2022 - Ben Greiner + +- Add support-setuptools60.patch gh#pytest-dev/pytest-cov#545 + +------------------------------------------------------------------- +Mon Dec 20 01:21:53 UTC 2021 - Steve Kowalik + +- Add support-coverage-62.patch: + * Support coverage >= 6.2 + +------------------------------------------------------------------- +Wed Nov 10 13:05:15 UTC 2021 - Ondřej Súkup + +- drop pytest-cov-pr453-coverage54.patch +- update to 3.0.0 + * drop support for py2 and python-3.5 + +------------------------------------------------------------------- +Tue Sep 14 08:45:47 UTC 2021 - Steve Kowalik + +- Inject multibuild to avoid build cycles. + +------------------------------------------------------------------- +Thu Feb 4 09:58:52 UTC 2021 - Ben Greiner + +- Add pytest-cov-pr453-coverage54.patch to work with coverage 5.4 + gh#pytest-dev/pytest-cov#453 + +------------------------------------------------------------------- +Wed Jan 27 13:51:26 UTC 2021 - Markéta Machová + +- Update to 2.11.1 + * Fixed the missing coverage context when using subprocesses. + * Bumped minimum coverage requirement to 5.2.1. This prevents reporting issues. +- Drop merged pytest62.patch + +------------------------------------------------------------------- +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 + +- Update to 2.10.1 + * Support for ``pytest-xdist`` 2.0, which breaks compatibility with ``pytest-xdist`` before 1.22.3 (from 2017). + * Fixed the ``LocalPath has no attribute startswith`` failure that occurred when using the ``pytester`` plugin + in inline mode. + * Dropped support for Python 3 < 3.4, Pytest < 3.5 and Coverage < 4.4. + +------------------------------------------------------------------- +Mon Jun 29 09:21:38 UTC 2020 - Marketa Calabkova + +- Update to 2.10.0 + * Improved the --no-cov warning. Now it's only shown if --no-cov is present before --cov. + * Removed legacy pytest support. Changed setup.py so that pytest>=4.6 is required. + +------------------------------------------------------------------- +Tue Jun 9 08:07:16 UTC 2020 - Tomáš Chvátal + +- Update to 2.9.0: + * Fixed RemovedInPytest4Warning when using Pytest 3.10. Contributed by Michael Manganiello in #354. + * Made pytest startup faster when plugin not active by lazy-importing. Contributed by Anders Hovmöller in #339. + * Various CI improvements. Contributed by Daniel Hahler in #363 and #364. + * Various Python support updates (drop EOL 3.4, test against 3.8 final). Contributed by Hugo van Kemenade in #336 and #367. + * Changed --cov-append to always enable data_suffix (a coverage setting). Contributed by Harm Geerts in #387. + * Changed --cov-append to handle loading previous data better (fixes various path aliasing issues). + * Various other testing improvements, github issue templates, example updates. + * Fixed internal failures that are caused by tests that change the current working directory by ensuring a consistent working directory when coverage is called. See #306 and coveragepy#881 + +------------------------------------------------------------------- +Wed Jan 15 12:50:24 UTC 2020 - Tomáš Chvátal + +- Skip test_cover_looponfail as it fails with new pytest + +------------------------------------------------------------------- +Thu Dec 5 04:06:23 UTC 2019 - Steve Kowalik + +- Skip 6 test cases that are causing problems with Python 3.8 + +------------------------------------------------------------------- +Wed Nov 6 13:25:11 CET 2019 - Matej Cepl + +- Switch off another test cases to make test suite pass. + gh#pytest-dev/pytest-cov#358 + +------------------------------------------------------------------- +Mon Oct 7 08:34:43 UTC 2019 - Tomáš Chvátal + +- Update to 2.8.1: + * Fixed #348 - regression when only certain reports (html or xml) are used then --cov-fail-under always fails. + * Added compatibility with future xdist release that deprecates some internals (match pytest-xdist master/worker terminology). Contributed by Thomas Grainger in #321 + * Added support for Coverage 5.0 + +------------------------------------------------------------------- +Mon May 6 11:04:02 UTC 2019 - Tomáš Chvátal + +- Update to 2.7.1: + * Fixed AttributeError: 'NoneType' object has no attribute 'configure_node' error when --no-cov is used. Contributed by Alexander Shadchin in #263. + * Various testing and CI improvements. Contributed by Daniel Hahler in #255, #266, #272, #271 and #269. + * Improved documentation regarding subprocess and multiprocessing. Contributed in #265. + * Improved pytest_cov.embed.cleanup_on_sigterm to be reentrant (signal deliveries while signal handling is running won't break stuff). + * Added pytest_cov.embed.cleanup_on_signal for customized cleanup. + * Improved cleanup code and fixed various issues with leftover data files. All contributed in #265 or #262. + * Improved examples. Now there are two examples for the common project layouts, complete with working coverage configuration. The examples have CI testing. Contributed in #267. + * Improved help text for CLI options. + +------------------------------------------------------------------- +Wed Feb 13 09:49:04 UTC 2019 - Tomáš Chvátal + +- Update to 2.6.1: + * Added support for Pytest 4.1. Contributed by Daniel Hahler and Семён Марьясин in #253 and #230. + * Various test and docs fixes. Contributed by Daniel Hahler in #224 and #223. + * Fixed the "Module already imported" issue (#211). Contributed by Daniel Hahler in #228. + +------------------------------------------------------------------- +Fri Oct 26 13:25:08 UTC 2018 - Ondřej Súkup + +- update to 2.6.0 +- cleanup deps + * Dropped support for Python < 3.4, Pytest < 3.5 and Coverage < 4.4 + * Fixed some documentation formatting. + * Added an example with addopts in documentation. + * Fixed TypeError: 'NoneType' object is not iterable in certain xdist configurations. + * Added a no_cover marker and fixture. + * Fixed broken no_cover check when running doctests. + * Fixed various issues with path normalization in reports + (when combining coverage data from parallel mode). + * Report generation failures don't raise exceptions anymore. + A warning will be logged instead. + +------------------------------------------------------------------- +Sun Sep 24 21:47:40 UTC 2017 - arun@gmx.de + +- update to version 2.5.1: + * Fixed xdist breakage (regression in 2.5.0). Fixes #157. + * Allow setting custom data_file name in .coveragerc. Fixes + #145. Contributed by Jannis Leidel & Ionel Cristian Mărieș in + #156. + +- changes from version 2.5.0: + * Always show a summary when --cov-fail-under is used. Contributed + by Francis Niu in PR#141. + * Added --cov-branch option. Fixes #85. + * Improve exception handling in subprocess setup. Fixes #144. + * Fixed handling when --cov is used multiple times. Fixes #151. + +------------------------------------------------------------------- +Wed Mar 1 16:38:13 UTC 2017 - aloisio@gmx.com + +- Update to version 2.4.0: + * Added a "disarm" option: --no-cov. It will disable coverage + measurements. Contributed by Zoltan Kozma in PR#135. + WARNING: Do not put this in your configuration files, it's meant + to be an one-off for situations where you want to disable coverage + from command line. + * Fixed broken exception handling on .pth file. See #136. +- Converted to single-spec +- Switched source URL to pypi.io + +------------------------------------------------------------------- +Thu Oct 22 13:53:36 UTC 2015 - toddrme2178@gmail.com + +- Update to version 2.2.0 + * Added support for changing working directory in tests. + Previously changing working directory would disable coverage + measurements in suprocesses. + * Fixed broken handling for --cov-report=annotate. +- Update to version 2.1.0 + * Added support for coverage 4.0b2. + * Added the --cov-append command line options. + Contributed by Christian Ledermann in PR#80. +- Update to version 2.0.0 + * Added --cov-fail-under, akin to the new fail_under option in + coverage-4.0 (automatically activated if there’s a + [report] fail_under = ... in .coveragerc). + * Changed --cov-report=term to automatically upgrade to + --cov-report=term-missing if there’s + [run] show_missing = True in .coveragerc. + * Changed --cov so it can be used with no path argument + (in wich case the source settings from .coveragerc will + be used instead). + * Fixed .pth installation to work in all cases + (install, easy_install, wheels, develop etc). + * Fixed .pth uninstallation to work for wheel installs. + * Support for coverage 4.0. + * Data file suffixing changed to use coverage’s + data_suffix=True option (instead of the custom suffixing). + * Avoid warning about missing coverage data + (just like coverage.control.process_startup). + * Fixed a race condition when running with xdist + (all the workers tried to combine the files). + It’s possible that this issue is not present in + pytest-cov 1.8.X. + +------------------------------------------------------------------- +Tue May 12 11:12:31 UTC 2015 - benoit.monin@gmx.fr + +- update to version 1.8.1: + * no changelog available +- update project URL +- increase minimum version of python-cov-core and python-pytest +- set a minimum version for python-py + +------------------------------------------------------------------- +Wed Jul 30 07:27:46 UTC 2014 - toddrme2178@gmail.com + +- Update to 1.7.0 + * No upstream changelog + +------------------------------------------------------------------- +Mon Aug 12 09:35:04 UTC 2013 - speilicke@suse.com + +- Initial version + diff --git a/python-pytest-cov.spec b/python-pytest-cov.spec new file mode 100644 index 0000000..4aba5fb --- /dev/null +++ b/python-pytest-cov.spec @@ -0,0 +1,102 @@ +# +# spec file for package python-pytest-cov +# +# Copyright (c) 2025 SUSE LLC and contributors +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%global flavor @BUILD_FLAVOR@%{nil} +%if "%{flavor}" == "test" +%bcond_without test +%define psuffix -%{flavor} +%else +%bcond_with test +%define psuffix %{nil} +%endif +%{?sle15_python_module_pythons} +Name: python-pytest-cov%{psuffix} +Version: 7.0.0 +Release: 0 +Summary: Pytest plugin for coverage reporting +License: MIT +URL: https://github.com/pytest-dev/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/pull/722 match coverage 7.10.7 warnings +Patch0: 0001-match-coverage-7.10.7-warnings.patch +BuildRequires: %{python_module base >= 3.9} +BuildRequires: %{python_module hatch-fancy-pypi-readme} +BuildRequires: %{python_module hatchling} +BuildRequires: %{python_module pip} +%if %{with test} +BuildRequires: %{python_module coverage >= 7.10.6} +BuildRequires: %{python_module fields} +BuildRequires: %{python_module process-tests} +BuildRequires: %{python_module pytest-cov = %{version}} +BuildRequires: %{python_module pytest-xdist} +BuildRequires: %{python_module virtualenv} +%endif +BuildRequires: fdupes +BuildRequires: python-rpm-macros +Requires: python-coverage >= 7.10.6 +Requires: python-pluggy >= 1.2 +Requires: python-pytest >= 6.2.5 +BuildArch: noarch +%python_subpackages + +%description +This plugin produces coverage reports. It supports centralised testing +and distributed testing in both load and each modes. It also supports +coverage of subprocesses. + +All features offered by the coverage package should be available, either +through pytest-cov or through coverage's config file. + +%prep +%autosetup -p1 -n pytest_cov-%{version} + +%build +%pyproject_wheel + +%install +%if ! %{with test} +%pyproject_install +%python_expand %fdupes %{buildroot}%{$python_sitelib}/ +%endif + +%check +%if %{with test} +echo "import site;site.addsitedir(\"$(pwd)/src\")" > tests/sitecustomize.py +# test_dist_missing_data - needs internet access +# test_central_subprocess_change_cwd_with_pythonpath - needs pytest cov in venv which is not doable in OBS build +donttest="test_dist_missing_data or test_central_subprocess_change_cwd_with_pythonpath" +# test_celery - requires testcontainers, not packaged +donttest+=" or test_celery" +# Broken with new version of coverage +donttest+=" or test_subprocess_with_path_aliasing or test_central_subprocess" +donttest+=" or test_dist_subprocess_not_collocated or test_cleanup_on_sigterm" +donttest+=" or test_append_coverage_subprocess or test_dist_subprocess_collocated" +# Broken with Python 3.14 https://github.com/pytest-dev/pytest-cov/issues/719 +donttest+=" or test_contexts" +%pytest -v -k "not (${donttest})" +%endif + +%if ! %{with test} +%files %{python_files} +%license LICENSE +%doc AUTHORS.rst CHANGELOG.rst README.rst +%{python_sitelib}/pytest_cov +%{python_sitelib}/pytest_cov-%{version}.dist-info +%endif + +%changelog