Pytest-cov

Latest version: v7.1.0

Safety actively analyzes 1060146 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 6

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.

Page 1 of 6

© 2026 Safety CLI Cybersecurity Inc. All Rights Reserved.