12
0
Files
python-pytest-cov/support-coverage-75.patch
Steve Kowalik f12c30636b - 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.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:pytest/python-pytest-cov?expand=0&rev=49
2025-07-02 02:18:47 +00:00

30 lines
1.3 KiB
Diff

From 89bd477d5d176666e2d4f3e38983bb69a055a457 Mon Sep 17 00:00:00 2001
From: Steve Kowalik <steven@wedontsleep.org>
Date: Wed, 15 May 2024 14:08:51 +1000
Subject: [PATCH] Support Coverage 7.5's HTML report changes
Coverage 7.5 now writes out two other files when generating a HTML
report -- class_index and function_index. We check explicitly for which
files have been written, so add those two in if coverage is >= 7.5.
---
tests/test_pytest_cov.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/tests/test_pytest_cov.py b/tests/test_pytest_cov.py
index bd9df38..114d34b 100644
--- a/tests/test_pytest_cov.py
+++ b/tests/test_pytest_cov.py
@@ -292,7 +292,11 @@ def test_term_report_does_not_interact_with_html_output(testdir):
)
dest_dir = testdir.tmpdir.join(DEST_DIR)
assert dest_dir.check(dir=True)
- assert sorted(dest_dir.visit('**/*.html')) == [dest_dir.join('index.html'), dest_dir.join('test_funcarg_py.html')]
+ expected = [dest_dir.join('index.html'), dest_dir.join('test_funcarg_py.html')]
+ if coverage.version_info >= (7, 5):
+ expected.insert(0, dest_dir.join('function_index.html'))
+ expected.insert(0, dest_dir.join('class_index.html'))
+ assert sorted(dest_dir.visit('**/*.html')) == expected
assert dest_dir.join('index.html').check()
assert result.ret == 0