Skip to content

Update pytest-cov to 7.1.0#609

Open
pyup-bot wants to merge 1 commit intomasterfrom
pyup-update-pytest-cov-4.1.0-to-7.1.0
Open

Update pytest-cov to 7.1.0#609
pyup-bot wants to merge 1 commit intomasterfrom
pyup-update-pytest-cov-4.1.0-to-7.1.0

Conversation

@pyup-bot
Copy link
Copy Markdown
Collaborator

This PR updates pytest-cov from 4.1.0 to 7.1.0.

Changelog

7.1.0

------------------

* Fixed total coverage computation to always be consistent, regardless of reporting settings.
Previously some reports could produce different total counts, and consequently can make --cov-fail-under behave different depending on
reporting options.
See `641 <https://github.com/pytest-dev/pytest-cov/issues/641>`_.

* Improve handling of ResourceWarning from sqlite3.

The plugin adds warning filter for sqlite3 ``ResourceWarning`` unclosed database (since 6.2.0).
It checks if there is already existing plugin for this message by comparing filter regular expression.
When filter is specified on command line the message is escaped and does not match an expected message.
A check for an escaped regular expression is added to handle this case.

With this fix one can suppress ``ResourceWarning`` from sqlite3 from command line::

 pytest -W "ignore:unclosed database in <sqlite3.Connection object at:ResourceWarning" ...
* Various improvements to documentation.
Contributed by Art Pelling in `718 <https://github.com/pytest-dev/pytest-cov/pull/718>`_ and
"vivodi" in `738 <https://github.com/pytest-dev/pytest-cov/pull/738>`_.
Also closed `736 <https://github.com/pytest-dev/pytest-cov/issues/736>`_.
* Fixed some assertions in tests.
Contributed by in Markéta Machová in `722 <https://github.com/pytest-dev/pytest-cov/pull/722>`_.
* Removed unnecessary coverage configuration copying (meant as a backup because reporting commands had configuration side-effects before coverage 5.0).

7.0.0

------------------

* Dropped support for subprocesses measurement.

It was a feature added long time ago when coverage lacked a nice way to measure subprocesses created in tests.
It relied on a ``.pth`` file, there was no way to opt-out and it created bad interations
with `coverage's new patch system <https://coverage.readthedocs.io/en/latest/config.html#run-patch>`_ added
in `7.10 <https://coverage.readthedocs.io/en/7.10.6/changes.html#version-7-10-0-2025-07-24>`_.

To migrate to this release you might need to enable the suprocess patch, example for ``.coveragerc``:

.. code-block:: ini

 [run]
 patch = subprocess

This release also requires at least coverage 7.10.6.
* Switched packaging to have metadata completely in ``pyproject.toml`` and use `hatchling <https://pypi.org/project/hatchling/>`_ for
building.
Contributed by Ofek Lev in `551 <https://github.com/pytest-dev/pytest-cov/pull/551>`_
with some extras in `716 <https://github.com/pytest-dev/pytest-cov/pull/716>`_.
* Removed some not really necessary testing deps like ``six``.

6.3.0

------------------

* Added support for markdown reports.
Contributed by Marcos Boger in `712 <https://github.com/pytest-dev/pytest-cov/pull/712>`_
and `714 <https://github.com/pytest-dev/pytest-cov/pull/714>`_.
* Fixed some formatting issues in docs.
Anonymous contribution in `706 <https://github.com/pytest-dev/pytest-cov/pull/706>`_.

6.2.1

------------------

* Added a version requirement for pytest's pluggy dependency (1.2.0, released 2023-06-21) that has the required new-style hookwrapper API.
* Removed deprecated license classifier (packaging).
* Disabled coverage warnings in two more situations where they have no value:

* "module-not-measured" in workers
* "already-imported" in subprocesses

6.2.0

------------------

* The plugin now adds 3 rules in the filter warnings configuration to prevent common coverage warnings being raised as obscure errors::

 default:unclosed database in <sqlite3.Connection object at:ResourceWarning
 once::PytestCovWarning
 once::CoverageWarning

This fixes most of the bad interactions that are occurring on pytest 8.4 with ``filterwarnings=error``.

The plugin will check if there already matching rules for the 3 categories
(``ResourceWarning``, ``PytestCovWarning``, ``CoverageWarning``) and message (``unclosed database in <sqlite3.Connection object at``) before adding the filters.

This means you can have this in your pytest configuration for complete oblivion (not recommended, if that is not clear)::

 filterwarnings = [
     "error",
     "ignore:unclosed database in <sqlite3.Connection object at:ResourceWarning",
     "ignore::PytestCovWarning",
     "ignore::CoverageWarning",
 ]

6.1.1

------------------

* Fixed breakage that occurs when ``--cov-context`` and the ``no_cover`` marker are used together.

6.1.0

------------------

* Change terminal output to use full width lines for the coverage header.
Contributed by Tsvika Shapira in `678 <https://github.com/pytest-dev/pytest-cov/pull/678>`_.
* Removed unnecessary CovFailUnderWarning. Fixes `675 <https://github.com/pytest-dev/pytest-cov/issues/675>`_.
* Fixed the term report not using the precision specified via ``--cov-precision``.

6.0.0

------------------

* Updated various documentation inaccuracies, especially on subprocess handling.
* Changed fail under checks to use the precision set in the coverage configuration.
Now it will perform the check just like ``coverage report`` would.
* Added a ``--cov-precision`` cli option that can override the value set in your coverage configuration.
* Dropped support for now EOL Python 3.8.

5.0.0

------------------

* Removed support for xdist rsync (now deprecated).
Contributed by Matthias Reichenbach in `623 <https://github.com/pytest-dev/pytest-cov/pull/623>`_.
* Switched docs theme to Furo.
* Various legacy Python cleanup and CI improvements.
Contributed by Christian Clauss and Hugo van Kemenade in
`630 <https://github.com/pytest-dev/pytest-cov/pull/630>`_,
`631 <https://github.com/pytest-dev/pytest-cov/pull/631>`_,
`632 <https://github.com/pytest-dev/pytest-cov/pull/632>`_ and
`633 <https://github.com/pytest-dev/pytest-cov/pull/633>`_.
* Added a ``pyproject.toml`` example in the docs.
Contributed by Dawn James in `626 <https://github.com/pytest-dev/pytest-cov/pull/626>`_.
* Modernized project's pre-commit hooks to use ruff. Initial POC contributed by
Christian Clauss in `584 <https://github.com/pytest-dev/pytest-cov/pull/584>`_.
* Dropped support for Python 3.7.
Links

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (5f02dc7) to head (553e792).

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #609   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           12        12           
  Lines          126       126           
=========================================
  Hits           126       126           
Flag Coverage Δ
?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant