NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI · #104 most downloaded on PyPI
Code coverage measurement for Python
Last release 7 days ago
27 Sep 2026
Ships fairly regularly
a new release about every 2 weeks
Nearly every release is documented
notes for 59 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
17 years old
197 releases · first in 2009
Fix: on Python 3.14 and later, a for loop completing immediately before a function return could mistakenly report an uncovered branch. This is now fix
for loop completing immediately before a function return could mistakenly report an uncovered branch. This is now fixed, closing issue 2168.else clause of a try whose body is a with statement could incorrectly be reported as covered when the with raised. This is now fixed, closing issue 2289.dynamic_context = test_function, test methods written as @staticmethod or @classmethod were not given a context of their own. Now they are, on Python 3.11 and later. Closes issue 1923.➡️ PyPI page: coverage 7.16.2.
➡️ To install: python3 -m pip install coverage==7.16.2
One column per quarter.
Fix: when the body of an irrefutable case (like case _: ) is entirely excluded, the case line is now excluded too, just as an excluded else: body remo
case (like case _:) is entirely excluded, the case line is now excluded too, just as an excluded else: body removes the else: line. Previously the case line was left behind and reported as missing. Closes issue 1563 with pull 2269.➡️ PyPI page: coverage 7.16.1.
➡️ To install: python3 -m pip install coverage==7.16.1
Fix: when the body of an irrefutable case (like case _:) is entirely excluded, the case line is now excluded too, just as an excluded else: body removes the else: line. Previously the case line was left behind and reported as missing. Closes issue 1563 with pull 2269.
Fix: using .CoverageData.update twice on an in-memory database would fail, as described in issue 2279. This is now fixed.
When combining files, now path separator slashes will automatically be converted to the local file system style. This makes it less necessary to defin
[paths] configuration to combine data across operating systems. Fixes issue 2266.[paths] pattern would be replaced everywhere in a file path when it was only meant to be replaced once, in the leading portion of the path. This is now fixed, in pull 2268.--contexts option (or the [report] contexts setting) reported a confusing “Couldn’t use data file …: user-defined function raised exception” error. Now it raises a proper configuration error naming the bad regex, like other regex settings do (pull 2262).omit, exclude_lines, or a [paths] entry), file settings like data_file, and any wrong-typed value in the [paths] section (pull 2263).coverage run refuses run-affecting command-line options like --branch alongside --concurrency=multiprocessing, since they can’t reach the subprocesses. The check only recognized multiprocessing as the entire option value, so --concurrency=multiprocessing,thread slipped through and failed later with “Can’t combine statement coverage data with branch data”. Each named concurrency library is now properly considered (pull 2270).coverage annotate -d DIR raised an AssertionError if any measured file had an extension other than .py, such as a .pyw file on Windows. The original extension is now restored on the annotated copy (pull 2265).➡️ PyPI page: coverage 7.16.0.
➡️ To install: python3 -m pip install coverage==7.16.0
Fix: in the HTML report, a source file name containing a double quote (legal on POSIX) wasn’t escaped where it’s dropped into the href of the index an
href of the index and prev/next links, so it could close the attribute early and inject markup. Page URLs are now escaped. Thanks, Rajath Mohare.➡️ PyPI page: coverage 7.15.4.
➡️ To install: python3 -m pip install coverage==7.15.4
Fix: the sysmon core is incompatible with dynamic contexts. Previously, the combination would be prevented when read from the coverage.py configuratio
➡️ PyPI page: coverage 7.15.3.
➡️ To install: python3 -m pip install coverage==7.15.3
Fix: one of the performance improvements in 7.15.1 (pull 2215) dramatically increased memory use during reporting for large projects. Now we use a dif
➡️ PyPI page: coverage 7.15.2.
➡️ To install: python3 -m pip install coverage==7.15.2
Fix: in the HTML report with show_contexts enabled, a context label containing </script> (for example a parametrized pytest node id) could close the i
show_contexts enabled, a context label containing </script> (for example a parametrized pytest node id) could close the inline <script> element in a file page early, injecting markup. Context labels are now fully escaped. Thanks, Rajath Mohare.➡️ PyPI page: coverage 7.15.1.
➡️ To install: python3 -m pip install coverage==7.15.1
Fix: in the HTML report with show_contexts enabled, a context label containing </script> (for example a parametrized pytest node id) could close the inline <script> element in a file page early, injecting markup. Context labels are now fully escaped. Thanks, Rajath Mohare.
A number of performance improvements thanks to Paul Kehrer, in pull requests 2213, 2214, 2215, 2216, 2218, 2220, and 2221.
When running your program, coverage now correctly sets yourmodule.__spec__.loader as strongly recommended , avoiding the deprecation warning described…
--keep-combined to retain the data files after combining them instead of the default, which is to delete them. Finishes issue 2198.yourmodule.__spec__.loader as strongly recommended, avoiding the deprecation warning described in issue 2208. Thanks, A5rocks.-I (isolated mode) option didn’t correctly omit the current directory from the module search path, as described in issue 2103. That is now fixed thanks to Ilia Sorokin.➡️ PyPI page: coverage 7.15.0.
➡️ To install: python3 -m pip install coverage==7.15.0
Fix: the default ... exclusion rule now also matches function bodies whose closing return-type bracket is on its own line (for example, after a long -
... exclusion rule now also matches function bodies whose closing return-type bracket is on its own line (for example, after a long -> dict[ ... ] annotation that a formatter has split over multiple lines). Closes issue 2185, thanks Mengjia Shang.Couldn't import C tracer errors. We can’t import the C tracer because in 7.14.2 we stopped shipping compiled wheels for 3.13t. Thanks, Hugo van Kemenade.➡️ PyPI page: coverage 7.14.3.
➡️ To install: python3 -m pip install coverage==7.14.3
Fix: some messages were being written to stdout, making coverage json -o - useless for capturing JSON output. Now messages are written to stderr, fixi
coverage json -o - useless for capturing JSON output. Now messages are written to stderr, fixing issue 2197.CoverageData kept one SQLite connection per thread that recorded coverage, but never closed them when those threads terminated. On long runs with many short-lived threads this leaked one file descriptor per dead thread, eventually failing with OSError: [Errno 24] Too many open files. Connections belonging to terminated threads are now closed and dropped. Fixes issue 2192. Thanks, Matthew Lloyd.COVERAGE_ID tool id. But other tools might also assume they could use that id. Pre-allocated ids don’t really make sense, so now we search for a usable one instead. Fixes issue 2187.➡️ PyPI page: coverage 7.14.2.
➡️ To install: python3 -m pip install coverage==7.14.2
Fix: the HTML report used typographic niceties to make file paths more readable by adding a small amount of space around slashes. Those spaces interfe
➡️ PyPI page: coverage 7.14.1.
➡️ To install: python3 -m pip install coverage==7.14.1
We are no longer testing eventlet support. Eventlet started issuing stern deprecation warnings that break our tests. Our support code is still there.
combine was too verbose, listing each file considered. Now it shows a single line with the counts of files combined, files skipped, and files with errors. The -q flag suppresses this line. The old detailed lines are available with the new --debug=combine option.Collector.flush_data could fail with “RuntimeError: Set changed size during iteration” when a tracer in another thread added a line to the per-file set that add_lines (or add_arcs) was iterating. The values passed to CoverageData are now snapshotted via dict.copy() and set.copy(), which are atomic under the GIL. Thanks, Alex Vandiver.lazy is now bolded in HTML reports.➡️ PyPI page: coverage 7.14.0.
➡️ To install: python3 -m pip install coverage==7.14.0
Fix: issue 2138 describes a memory leak that happened when repeatedly using the Coverage API with in-memory data. This is now fixed.
➡️ PyPI page: coverage 7.13.5.
➡️ To install: python3 -m pip install coverage==7.13.5
Fix: issue 2138 describes a memory leak that happened when repeatedly using the Coverage API with in-memory data. This is now fixed.
Fix: the markdown-formatted coverage report didn't fully escape special characters in file paths (issue 2141). This would be very unlikely to cause a problem, but now it's done properly, thanks to Ellie Ayla.
Fix: the C extension wouldn't build on VS2019, but now it does (issue 2145).
Fix: the third-party code fix in 7.13.3 required examining the parent directories where coverage was run. In the unusual situation that one of the par
:arrow_right: PyPI page: coverage 7.13.4.
:arrow_right: To install: python3 -m pip install coverage==7.13.4
Fix: in some situations, third-party code was measured when it shouldn’t have been, slowing down test execution. This happened with layered virtual en
:arrow_right: PyPI page: coverage 7.13.3.
:arrow_right: To install: python3 -m pip install coverage==7.13.3
Fix: when Python is installed via symlinks, for example with Homebrew, the standard library files could be incorrectly included in coverage reports. T
:arrow_right: PyPI page: coverage 7.13.2.
:arrow_right: To install: python3 -m pip install coverage==7.13.2
Added: the JSON report now includes a "start_line" key for function and class regions, indicating the first line of the region in the source. Closes i
"start_line" key for function and class regions, indicating the first line of the region in the source. Closes issue 2110.debug data command now takes file names as arguments on the command line, so you can inspect specific data files without needing to set the COVERAGE_FILE environment variable.COVERAGE_CORE wasn’t set on 3.14+. This is now fixed, closing issue 2109.:arrow_right: PyPI page: coverage 7.13.1.
:arrow_right: To install: python3 -m pip install coverage==7.13.1
Deprecated: when coverage.py is installed, it creates three command entry points: coverage, coverage3, and coverage-3.10 (if installed for Python 3.10…
.coveragerc.toml configuration files. These files use TOML syntax and take priority over pyproject.toml but lower priority than .coveragerc files. Closes issue 1643 thanks to Olena Yefymenko.py3-none-any). This is now fixed. Thanks, Henry Schreiner.coverage, coverage3, and coverage-3.10 (if installed for Python 3.10). The second and third of these are not needed and will eventually be removed. They still work for now, but print a message about their deprecation.:arrow_right: PyPI page: coverage 7.13.0.
:arrow_right: To install: python3 -m pip install coverage==7.13.0
Fix: coverage.py now includes a permanent .pth file in the distribution which is installed with the code. This fixes issue 2084: failure to patch for
:arrow_right: PyPI page: coverage 7.12.1b1.
:arrow_right: To install: python3 -m pip install coverage==7.12.1b1
Fix: coverage.py now includes a permanent .pth file in the distribution which is installed with the code. This fixes issue 2084: failure to patch for subprocess measurement when site-packages is not writable.
The HTML report now shows separate coverage totals for statements and branches, as well as the usual combined coverage percentage. Thanks to Ryuta Ots
except* clauses were not handled properly under the “sysmon” measurement core, causing KeyError exceptions as described in issue 2086. This is now fixed.open() that could cause errors inside coverage.py. An example of a failure is in issue 2083.open(), coverage.py would fail when trying to open source files, as described in issue 2091. This is now fixed.:arrow_right: PyPI page: coverage 7.12.0.
:arrow_right: To install: python3 -m pip install coverage==7.12.0
Nothing published for this version
…other settings would raise an error. This was a breaking change from previous behavior, as reported in issue 2076 and issue 2078.
Fix: the 7.11.1 changes meant that conflicts between a requested measurement core and other settings would raise an error. This was a breaking change from previous behavior, as reported in issue 2076 and issue 2078.
The previous behavior has been restored: when the requested core conflicts with other settings, another core is used instead, and a warning is issued.
For contributors: the repo has moved from Ned’s nedbat GitHub account to the coveragepy GitHub organization. The default branch has changed from master to main.
:arrow_right: PyPI page: coverage 7.11.3.
:arrow_right: To install: python3 -m pip install coverage==7.11.3
Fix: the 7.11.1 changes meant that conflicts between a requested measurement core and other settings would raise an error. This was a breaking change from previous behavior, as reported in issue 2076 and issue 2078.
The previous behavior has been restored: when the requested core conflicts with other settings, another core is used instead, and a warning is issued.
For contributors: the repo has moved from Ned's nedbat GitHub account to the coveragepy GitHub organization. The default branch has changed from master to main.
Fix: using the “sysmon” measurement core in 7.11.1, if Python code was claimed to come from a non-Python file, a NotPython exception could be raised.
NotPython exception could be raised. This could happen for example with Jinja templates compiled to Python, as reported in issue 2077. This is now fixed.:arrow_right: PyPI page: coverage 7.11.2.
:arrow_right: To install: python3 -m pip install coverage==7.11.2
Fix: some chanages to details of how the measurement core is chosen, and how conflicting settings are handled. The “sysmon” core cannot be used with s
breakpoint() would stop in the wrong frame, one level down from where it should, as described in issue 1420. This was due to a coverage change in v6.4.1 that seemed to give a slight performance improvement, but I couldn’t reproduce the performance gain, so it’s been reverted, fixing the debugger problem.--debug=core shows which core is in use and why.sqlite debugging information out of the sys coverage debug and --debug option options since it’s bulky and not very useful.:arrow_right: PyPI page: coverage 7.11.1.
:arrow_right: To install: python3 -m pip install coverage==7.11.1
Dropped support for Python 3.9, declared support for Python 3.15 alpha.
:arrow_right: PyPI page: coverage 7.11.0.
:arrow_right: To install: python3 -m pip install coverage==7.11.0
Dropped support for Python 3.9, declared support for Python 3.15 alpha.
Performance: with branch coverage in large files, generating HTML, JSON, or LCOV reports could take far too long due to some quadratic behavior when c
:arrow_right: PyPI page: coverage 7.10.7.
:arrow_right: To install: python3 -m pip install coverage==7.10.7
Fix: source directories were not properly communicated to subprocesses that ran in different directories, as reported in issue 1499. This is now fixed
source directories were not properly communicated to subprocesses that ran in different directories, as reported in issue 1499. This is now fixed.:arrow_right: PyPI page: coverage 7.10.6.
:arrow_right: To install: python3 -m pip install coverage==7.10.6
Fix: source directories were not properly communicated to subprocesses that ran in different directories, as reported in issue 1499. This is now fixed.
Performance: Alex Gaynor continues fine-tuning the speed of combination, especially with many contexts.
Big speed improvements for coverage combine: it’s now about twice as fast! Huge thanks to Alex Gaynor for pull requests 2032, 2033, and 2034.
coverage combine: it’s now about twice as fast! Huge thanks to Alex Gaynor for pull requests 2032, 2033, and 2034.:arrow_right: PyPI page: coverage 7.10.5.
:arrow_right: To install: python3 -m pip install coverage==7.10.5
Added patch = fork for times when the built-in forking support is insufficient.
patch = fork for times when the built-in forking support is insufficient.patch = execv also inherits the entire coverage configuration now.:arrow_right: PyPI page: coverage 7.10.4.
:arrow_right: To install: python3 -m pip install coverage==7.10.4
Added patch = fork for times when the built-in forking support is insufficient.
Fix: patch = execv also inherits the entire coverage configuration now.
If subprocesses spawned yet more subprocesses simultaneously, some coverage could be missed. This is now fixed, closing issue 2024.
patch = subprocess:
ModuleNotFound error trying to import coverage. This is now fixed, closing issue 2022.coverage run command line (such as --branch) wouldn’t be communicated to the subprocesses. This could lead to combining failures, as described in issue 2021. Now the entire configuration is used in subprocesses, regardless of its origin.debug=patch to help diagnose problems.:arrow_right: PyPI page: coverage 7.10.3.
:arrow_right: To install: python3 -m pip install coverage==7.10.3
Fix: some code with NOP bytecodes could report missing branches that are actually executed. This is now fixed, closing issue 1999. Python 3.9 still sh
:arrow_right: PyPI page: coverage 7.10.2.
:arrow_right: To install: python3 -m pip install coverage==7.10.2
Fix: some code with NOP bytecodes could report missing branches that are actually executed. This is now fixed, closing issue 1999. Python 3.9 still shows the problem.
Fix: the exclusion for if TYPE_CHECKING: was wrong: it marked the branch as partial, but it should have been a line exclusion so the entire clause wou
if TYPE_CHECKING: was wrong: it marked the branch as partial, but it should have been a line exclusion so the entire clause would be excluded. Improves issue 831.patch = subprocess, closing issue 2006.:arrow_right: PyPI page: coverage 7.10.1.
:arrow_right: To install: python3 -m pip install coverage==7.10.1
Fix: the exclusion for if TYPE_CHECKING: was wrong: it marked the branch as partial, but it should have been a line exclusion so the entire clause would be excluded. Improves `issue 831`_.
Fix: changed where .pth files are written for patch = subprocess, closing issue 2006.
A new configuration option: “[\[run\] patch](https://coverage.readthedocs.io/en/latest/config.html#config-run-patch)” specifies named patches to work
patch = _exit lets coverage save its data even when https://docs.python.org/3/library/os.html#os._exit is used to abruptly end the process. This closes long-standing issue 310 as well as its duplicates: issue 312, issue 1673, issue 1845, and issue 1941.patch = subprocess measures coverage in Python subprocesses created with https://docs.python.org/3/library/subprocess.html#module-subprocess, https://docs.python.org/3/library/os.html#os.system, or one of the https://docs.python.org/3/library/os.html#os.execl or https://docs.python.org/3/library/os.html#os.spawnl family of functions. Closes old issue 367, its duplicate issue 378 and old issue 689.patch = execv adjusts the https://docs.python.org/3/library/os.html#os.execl family of functions to save coverage data before ending the current program and starting the next. Not available on Windows. Closes issue 43 after 15 years!... is automatically excluded as a line and if TYPE_CHECKING: is excluded as a branch. Closes issue 831.--save-signal=USR1 specifies a signal that coverage.py will listen for. When the signal is sent, the coverage data will be saved. This makes it possible to save data from within long-running processes. Thanks, Arkady Gilinsky.:arrow_right: PyPI page: coverage 7.10.0.
:arrow_right: To install: python3 -m pip install coverage==7.10.0
A new configuration option: "config_run_patch" specifies named patches to work around some limitations in coverage measurement. These patches are available:
patch = _exit lets coverage save its data even when os._exit() is used to abruptly end the process. This closes long-standing issue 310 as well as its duplicates: issue 312, issue 1673, issue 1845, and issue 1941.
patch = subprocess measures coverage in Python subprocesses created with subprocess, os.system, or one of the execv or spawnv family of functions. Closes old issue 367, its duplicate issue 378 and old issue 689.
patch = execv adjusts the execv family of functions to save coverage data before ending the current program and starting the next. Not available on Windows. Closes issue 43 after 15 years!
The HTML report now dimly colors subsequent lines in multi-line statements. They used to have no color. This gives a better indication of the amount of code missing in the report. Closes issue 1308.
Two new exclusion patterns are part of the defaults: ... is automatically excluded as a line and if TYPE_CHECKING: is excluded as a branch. Closes issue 831.
A new command-line option: --save-signal=USR1 specifies a signal that coverage.py will listen for. When the signal is sent, the coverage data will be saved. This makes it possible to save data from within long-running processes. Thanks, Arkady Gilinsky.
A new configuration option: "config_report_partial_also" is a list of regexes to add as pragmas for partial branches. This parallels the "config_report_exclude_also" setting for adding line exclusion patterns.
A few file path configuration settings didn't allow for tilde expansion: config_json_output, config_lcov_output and config_run_debug_file. This is now fixed.
Wheels are included for 3.14 now that 3.14 rc1 is available.
We no longer ship a PyPy-specific wheel. PyPy will install the pure-Python wheel. Closes issue 2001.
In the very unusual situation of not having a current frame, coverage no longer crashes when using the sysmon core, fixing issue 2005.
Fix: complex conditionals within a line might cause a KeyError when using sys.monitoring, as reported in issue 1991. This is now fixed.
:arrow_right: PyPI page: coverage 7.9.2.
:arrow_right: To install: python3 -m pip install coverage==7.9.2
Fix: complex conditionals within a line might cause a KeyError when using sys.monitoring, as reported in issue 1991. This is now fixed.
Fix: we can now measure coverage for code in Python archive (.par) files. Thanks, Itamer Oren.
The “no-ctracer” warning is not issued for Python pre-release versions. Coverage doesn’t ship compiled wheels for those versions, so this was far too
:arrow_right: PyPI page: coverage 7.9.1.
:arrow_right: To install: python3 -m pip install coverage==7.9.1
Added a [run] core configuration setting to specify the measurement core, which was previously only available through the COVERAGE\_CORE environment v
[run] core configuration setting to specify the measurement core, which was previously only available through the COVERAGE_CORE environment variable. Finishes issue 1746.:arrow_right: PyPI page: coverage 7.9.0.
:arrow_right: To install: python3 -m pip install coverage==7.9.0
Added a [run] core configuration setting to specify the measurement core, which was previously only available through the COVERAGE_CORE environment variable. Finishes issue 1746.
Fixed incorrect rendering of f-strings with doubled braces, closing issue 1980.
If the C tracer core can't be imported, a warning ("no-ctracer") is issued with the reason.
The C tracer core extension module now conforms to PEP 489, closing issue 1977. Thanks, Adam Turner.
Fixed a "ValueError: min() arg is an empty sequence" error caused by strange empty modules, found by oss-fuzz.
Wheels are provided for Windows ARM64 on Python 3.11, 3.12, and 3.13. Thanks, Finn Womack.
:arrow_right: PyPI page: coverage 7.8.2.
:arrow_right: To install: python3 -m pip install coverage==7.8.2
Wheels are provided for Windows ARM64 on Python 3.11, 3.12, and 3.13. Thanks, Finn Womack.
A number of EncodingWarnings were fixed that could appear if you’ve enabled PYTHONWARNDEFAULTENCODING, fixing issue 1966. Thanks, Henry Schreiner.
:arrow_right: PyPI page: coverage 7.8.1.
:arrow_right: To install: python3 -m pip install coverage==7.8.1
A number of EncodingWarnings were fixed that could appear if you've enabled PYTHONWARNDEFAULTENCODING, fixing issue 1966. Thanks, Henry Schreiner.
Fixed a race condition when using sys.monitoring with free-threading Python, closing issue 1970.
Added a new source_dirs setting for symmetry with the existing source_pkgs setting. It’s preferable to the existing source setting, because you’ll get
source_dirs setting for symmetry with the existing source_pkgs setting. It’s preferable to the existing source setting, because you’ll get a clear error when directories don’t exist. Fixes issue 1942. Thanks, Jeremy Fleischman.coverage command on Windows. There you can use python -m coverage instead if you need exact emulation.:arrow_right: PyPI page: coverage 7.8.0.
:arrow_right: To install: python3 -m pip install coverage==7.8.0
A few small tweaks to the sys.monitoring support for Python 3.14. Please test!
:arrow_right: PyPI page: coverage 7.7.1.
:arrow_right: To install: python3 -m pip install coverage==7.7.1
A few small tweaks to the sys.monitoring support for Python 3.14. Please test!
The Coverage object has a new method, Coverage.branch\_stats() for getting simple branch information for a module. Closes issue 1888.
plugins parameter for passing in plugin objects directly, thanks to Alex Gaynor.if 13: would have been considered a branch with one path not taken. Now it is understood as always true and no coverage is missing.COVERAGE_CORE=sysmon to try it out.:arrow_right: PyPI page: coverage 7.7.0.
:arrow_right: To install: python3 -m pip install coverage==7.7.0
Fix: some aarch64 distributions were missing (issue 1927). These are now building reliably.
:arrow_right: PyPI page: coverage 7.6.12.
:arrow_right: To install: python3 -m pip install coverage==7.6.12
Fix: some aarch64 distributions were missing (issue 1927). These are now building reliably.
Fix: a memory leak in CTracer has been fixed. The details are in issue 1924 and pytest-dev 676. This should reduce the memory footprint for everyone e
:arrow_right: PyPI page: coverage 7.6.11.
:arrow_right: To install: python3 -m pip install coverage==7.6.11
Fix: a memory leak in CTracer has been fixed. The details are in issue 1924 and pytest-dev 676. This should reduce the memory footprint for everyone even if it hadn't caused a problem before.
We now ship a py3-none-any.whl wheel file. Thanks, Russell Keith-Magee.
Fix: some descriptions of missing branches in HTML and LCOV reports were incorrect when multi-line statements were involved (issue 1874 and issue 1875
git bisect helped find it, and now it’s fixed.:arrow_right: PyPI page: coverage 7.6.10.
:arrow_right: To install: python3 -m pip install coverage==7.6.10
Fix: some descriptions of missing branches in HTML and LCOV reports were incorrect when multi-line statements were involved (issue 1874 and issue 1875). These are now fixed.
Fix: Python 3.14 defers evaluation of annotations by moving them into separate code objects. That code is rarely executed, so coverage.py would mark them as missing, as reported in issue 1908. Now they are ignored by coverage automatically.
Fixed an obscure and mysterious problem on PyPy 3.10 seemingly involving mocks, imports, and trace functions: issue 1902. To be honest, I don't understand the problem or the solution, but git bisect helped find it, and now it's fixed.
Docs: re-wrote the subprocess page to put multiprocessing first and to highlight the correct use of multiprocessing.Pool.
Fix: Tomas Uribe fixed a performance problem in the XML report. Large code bases should produce XML reports much faster now.
:arrow_right: PyPI page: coverage 7.6.9.
:arrow_right: To install: python3 -m pip install coverage==7.6.9
Fix: Tomas Uribe fixed a performance problem in the XML report. Large code bases should produce XML reports much faster now.
Fix: the LCOV report code assumed that a branch line that took no branches meant that the entire line was unexecuted. This isn’t true in a few cases:
:arrow_right: PyPI page: coverage 7.6.8.
:arrow_right: To install: python3 -m pip install coverage==7.6.8
Fix: ugh, the other assert from 7.6.5 can also be encountered in the wild, so it’s been restored to a conditional. Sorry for the churn.
:arrow_right: PyPI page: coverage 7.6.7.
:arrow_right: To install: python3 -m pip install coverage==7.6.7
Fix: ugh, the other assert from 7.6.5 can also be encountered in the wild, so it's been restored to a conditional. Sorry for the churn.
One of the new asserts from 7.6.5 caused problems in real projects, as reported in issue 1891. The assert has been removed.
:arrow_right: PyPI page: coverage 7.6.6.
:arrow_right: To install: python3 -m pip install coverage==7.6.6
One of the new asserts from 7.6.5 caused problems in real projects, as reported in issue 1891. The assert has been removed.
Fix: fine-tuned the exact Python version (3.12.6) when exiting from with statements changed how they traced. This affected whether people saw the fix
with statements changed how they traced. This affected whether people saw the fix for issue 1880.:arrow_right: PyPI page: coverage 7.6.5.
:arrow_right: To install: python3 -m pip install coverage==7.6.5
Fix: multi-line with statements could cause contained branches to be incorrectly marked as missing (issue 1880). This is now fixed.
with statements could cause contained branches to be incorrectly marked as missing (issue 1880). This is now fixed.:arrow_right: PyPI page: coverage 7.6.4.
:arrow_right: To install: python3 -m pip install coverage==7.6.4
Fix: multi-line with statements could cause contained branches to be incorrectly marked as missing (issue 1880). This is now fixed.
Fix: nested context managers could incorrectly be analyzed to flag a missing branch on the last context manager, as described in issue 1876. This is n
:arrow_right: PyPI page: coverage 7.6.3.
:arrow_right: To install: python3 -m pip install coverage==7.6.3
Fix: nested context managers could incorrectly be analyzed to flag a missing branch on the last context manager, as described in issue 1876. This is now fixed.
Fix: the missing branch message about not exiting a module had an extra "didn't," as described in issue 1873. This is now fixed.
Dropped support for Python 3.8 and PyPy 3.8.
case _ as value) was incorrectly marked as a missing branch. This is now fixed, closing issue 1860.:arrow_right: PyPI page: coverage 7.6.2.
:arrow_right: To install: python3 -m pip install coverage==7.6.2
Fix: coverage used to fail when measuring code using with a argument. This is now fixed, thanks to Ask Hjorth Larsen.
:arrow_right: PyPI page: coverage 7.6.1.
:arrow_right: To install: python3 -m pip install coverage==7.6.1
Fix: coverage used to fail when measuring code using runpy.run_path with a Path argument. This is now fixed, thanks to Ask Hjorth Larsen.
Fix: backslashes preceding a multi-line backslashed string could confuse the HTML report. This is now fixed, thanks to LiuYinCarl.
Now we publish wheels for Python 3.13, both regular and free-threaded.
Exclusion patterns can now be multi-line, thanks to Daniel Diniz. This enables many interesting exclusion use-cases, including those requested in issu
:arrow_right: PyPI page: coverage 7.6.0.
:arrow_right: To install: python3 -m pip install coverage==7.6.0
Exclusion patterns can now be multi-line, thanks to Daniel Diniz. This enables many interesting exclusion use-cases, including those requested in issues 118 (entire files), 996 (multiple lines only when appearing together), 1741 (remainder of a function), and 1803 (arbitrary sequence of marked lines). See the multi_line_exclude section of the docs for more details and examples.
The JSON report now includes per-function and per-class coverage information. Thanks to Daniel Diniz for getting the work started. This closes issue 1793 and issue 1532.
Fixed an incorrect calculation of "(no class)" lines in the HTML classes report.
Python 3.13.0b3 is supported.
If you attempt to combine statement coverage data with branch coverage data, coverage.py used to fail with the message “Can’t combine arc data with li
:arrow_right: PyPI page: coverage 7.5.4.
:arrow_right: To install: python3 -m pip install coverage==7.5.4
Performance improvements for combining data files, especially when measuring line coverage. A few different quadratic behaviors were eliminated. In on
:arrow_right: PyPI page: coverage 7.5.3.
:arrow_right: To install: python3 -m pip install coverage==7.5.3
Fix: nested matches of exclude patterns could exclude too much code, as reported in issue 1779. This is now fixed.
:arrow_right: PyPI page: coverage 7.5.2.
:arrow_right: To install: python3 -m pip install coverage==7.5.2
Fix: a pragma comment on the continuation lines of a multi-line statement now excludes the statement and its body, the same as if the pragma is on the
:arrow_right: PyPI page: coverage 7.5.1.
:arrow_right: To install: python3 -m pip install coverage==7.5.1
Added initial support for function and class reporting in the HTML report. There are now three index pages which link to each other: files, functions,
:arrow_right: PyPI page: coverage 7.5.0.
:arrow_right: To install: python3 -m pip install coverage==7.5.0
Fix: in some cases, even with [run] relative_files=True, a data file could be created with absolute path names. When combined with other relative data
[run] relative_files=True, a data file could be created with absolute path names. When combined with other relative data files, it was random whether the absolute file names would be made relative or not. If they weren’t, then a file would be listed twice in reports, as detailed in issue 1752. This is now fixed: absolute file names are always made relative when combining. Thanks to Bruno Rodrigues dos Santos for support.report:format setting was defined as a boolean, but should be a string. Thanks, Tanaydin Sirin. It is also now documented on the configuration page.:arrow_right: PyPI page: coverage 7.4.4.
:arrow_right: To install: python3 -m pip install coverage==7.4.4
Your coding agent can read these notes before it upgrades. Set up the MCP server →