unstale

pypi / coverage

coverage

What changed in coverage 7, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-29.

10 breaking4 security2 deprecations7 new APIs and options8 performance7 behavior and defaults3 tooling57 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli on npm

coverage 798 changes

Breaking changes 10

  • Using a file system root as a source directory now produces an error instead of measuring no files.

    7.17.1release notes

  • Built-in patterns only match at the start of a statement, so comments or strings mentioning these patterns no longer mark branches as partial.

    7.17.0release notes

  • Support for Python 3.10 has been dropped.

    7.17.0release notes

  • When combining files, path separator slashes are converted to the local file system style, reducing the need for [paths] configuration across operating systems.

    7.16.0release notes

  • The project no longer distributes wheels for Python 3.13 free-threaded.

    7.14.2release notes

  • Reporting commands now implicitly combine parallel data files before creating a report; there is no option to avoid the combination.

    7.14.0release notes

  • Directories on sys.path inside a virtualenv are now considered third-party code, preventing them from being measured and slowing test execution.

    7.13.3release notes

  • SQLite debugging information is no longer included in the sys debug output because it is bulky and not very useful.

    7.11.1release notes

  • When the core defaults to sysmon but settings conflict with it, coverage uses ctrace without a warning. Explicitly requesting sysmon with conflicting settings now raises an error instead of a warning.

    7.11.1release notes

  • Support for Python 3.9 was dropped.

    7.11.0release notes

Security 4

  • Prevents forged SQLite journal files from deleting files they shouldn’t.

    7.17.1release notes

  • Page URLs are now escaped in the index and prev/next links, preventing file names containing double quotes from injecting markup.

    7.15.4release notes

  • Control characters in fields are now replaced, preventing file names containing newlines from forging records and inflating reported coverage.

    7.15.4release notes

  • Context labels are now fully escaped when show_contexts is enabled, preventing labels containing </script> from closing the inline script element and injecting markup.

    7.15.1release notes

Deprecations 2

  • The coverage-3.10 command entry point still works but prints a deprecation message and will eventually be removed.

    7.13.0release notes

  • The coverage3 command entry point still works but prints a deprecation message and will eventually be removed.

    7.13.0release notes

New APIs and options 7

  • Reporting commands can retain parallel data files after combining them instead of deleting them.

    7.15.0release notes

  • This new option displays the detailed lines about files considered that the command no longer prints by default.

    7.14.0release notes

  • The command now accepts file names as command-line arguments, allowing inspection of specific data files without setting COVERAGE_FILE.

    7.13.1release notes

  • The JSON report now includes start_line for function and class regions, indicating the first line of each region in the source.

    7.13.1release notes

  • coverage.py now supports TOML configuration files, which take priority over pyproject.toml but lower priority than .coveragerc files.

    7.13.0release notes

  • Includes separate statement and branch coverage totals.

    7.12.0release notes

  • Adds the core debug option to show which measurement core is in use and why.

    7.11.1release notes

Performance 8

  • On Python 3.13 and later, using the C tracer should make test suites run about 8% to 12% faster.

    7.17.3release notes

  • The text summary report keeps only the parsed source it needs to print, reducing memory use on large projects.

    7.17.0release notes

  • HTML reports should be about 5% faster to produce.

    7.17.0release notes

  • Low-level line number bookkeeping is faster when combining data files.

    7.15.3release notes

  • HTML reporting parses files fewer times, improving performance.

    7.15.3release notes

  • Reporting for large projects uses an approach that is faster and uses less memory than 7.15.0.

    7.15.2release notes

  • The release includes a number of performance improvements.

    7.15.1release notes

  • Data files being combined now record their hash in the file name, allowing duplicate data to be skipped more quickly.

    7.13.1release notes

Behavior and default changes 7

  • With dynamic_context = test_function, staticmethod and classmethod test methods receive a context of their own on Python 3.11 and later.

    7.16.2release notes

  • Using dynamic contexts with the sysmon core through the context API now issues a warning instead of silently dropping contexts.

    7.15.3release notes

  • The command now prints one line with counts of files combined, skipped, and errored instead of listing each file considered.

    7.14.0release notes

  • The flag now suppresses the command's single summary line.

    7.14.0release notes

  • The soft keyword lazy is now bolded in HTML reports.

    7.14.0release notes

  • Uses thin spaces around slashes in file paths to make them easier to read.

    7.12.0release notes

  • When the requested measurement core conflicts with other settings, another core is used and a warning is issued instead of raising an error.

    7.11.3release notes

Tooling 3

  • Binary wheels for iOS and Android allow use of the optimized C tracer on mobile platforms.

    7.17.0release notes

  • Wheels are now published for ppc64le.

    7.13.4release notes

  • Shows separate statement and branch coverage totals alongside the combined coverage percentage.

    7.12.0release notes

Fixes and other changes 57

  • When a listed parallel data file disappears during combining, coverage now reports a warning instead of stopping with a DataError.

    7.17.3release notes

  • Repeated function and class names now receive an @<line number> suffix so they are not lost from the report.

    7.17.3release notes

  • Child processes are now measured when using patch = fork, without also requiring patch = subprocess.

    7.17.3release notes

  • On Python 3.13, a measured subprocess stopped with SIGINT now dies from the signal rather than exiting with status 1.

    7.17.3release notes

  • Combining coverage data now works with SQLite versions older than 3.34.0, including versions on RHEL 8 and Ubuntu 20.04.

    7.17.2release notes

  • A data file without a coverage schema is reported as an unusable data file and left in place.

    7.17.2release notes

  • A data file without a coverage schema is reported as an unusable data file and left in place.

    7.17.2release notes

  • The comparison and failure message use at least the threshold’s decimal precision, avoiding rounded totals that produce incorrect results or messages.

    7.17.1release notes

  • Pages are rewritten when their neighboring files change, keeping previous- and next-file links current when the set of reported files changes.

    7.17.1release notes

  • File names containing ampersands, angle brackets, or quotes are escaped only once when displayed.

    7.17.1release notes

  • One-line class or function bodies followed by another statement are no longer incorrectly reported as missing branches when using the sys.monitoring core.

    7.17.1release notes

  • The error now identifies the two data files that could not be combined.

    7.17.0release notes

  • If a plugin method raises an exception, lines in that function are no longer recorded as belonging to a different file.

    7.17.0release notes

  • Newlines in file patterns are handled as ordinary characters instead of hanging the process during glob-to-regex translation.

    7.17.0release notes

  • An internal error while recording a new file is now reported as the actual exception instead of a confusing SystemError.

    7.17.0release notes

  • Duplicate function names are disambiguated with a line-number suffix to avoid complaints from recent lcov versions.

    7.17.0release notes

  • Three or more levels of nested with statements no longer create phantom partial branches or inflate branch totals.

    7.17.0release notes

  • XML, text, and Markdown summary reports, and coverage debug data, replace non-printable characters in file and plugin names.

    7.17.0release notes

  • Each save updates the file hash, preventing combining from skipping a file as a duplicate and losing data recorded after its first save.

    7.17.0release notes

  • Region detection now finds functions defined in unusual locations, including else and except clauses.

    7.17.0release notes

  • XML reports now avoid incorrect line-rate values when coverage totals are close to 0 or 100.

    7.17.0release notes

  • On Python 3.14 and later, a for loop immediately before a function return no longer mistakenly reports an uncovered branch.

    7.16.2release notes

  • On Python 3.14 and later, the else clause of a try whose body is a with statement is no longer incorrectly reported as covered when the with raises.

    7.16.2release notes

  • Calling CoverageData.update() twice on an in-memory database no longer fails.

    7.16.1release notes

  • When an irrefutable case body is entirely excluded, the case line is now excluded too, so it is no longer reported as missing.

    7.16.1release notes

  • An invalid regex now raises a proper configuration error naming the bad regex instead of a confusing data-file error.

    7.16.0release notes

  • Annotated copies now preserve the original extension, avoiding an AssertionError for measured files with extensions other than .py.

    7.16.0release notes

  • Each named concurrency library is considered when refusing run-affecting options that cannot reach subprocesses.

    7.16.0release notes

  • A [paths] pattern is now replaced only once, in the leading portion of a file path.

    7.16.0release notes

  • Negative precision settings now produce useful error messages.

    7.16.0release notes

  • Non-string values in TOML settings now produce helpful error messages instead of tracebacks, including list settings, file settings, and values in [paths].

    7.16.0release notes

  • Wheels are now provided for Python 3.15.

    7.15.4release notes

  • With Python 3.10 isolated mode, coverage now correctly omits the current directory from the module search path.

    7.15.0release notes

  • Excluded functions are no longer incorrectly counted as uncovered.

    7.15.0release notes

  • Coverage now sets the module loader while running your program, avoiding a deprecation warning.

    7.15.0release notes

  • On 3.13t, coverage no longer incorrectly issues C tracer import errors when the C tracer cannot be imported.

    7.14.3release notes

  • The default ... exclusion rule now matches function bodies whose closing return-type bracket is on its own line.

    7.14.3release notes

  • When using sys.monitoring, coverage now searches for a usable tool id instead of assuming it can use COVERAGE_ID.

    7.14.2release notes

  • Messages are now written to stderr, so coverage json -o - can be used to capture JSON output from stdout.

    7.14.2release notes

  • SQLite connections belonging to terminated threads are now closed and dropped, preventing file descriptor leaks during long runs with many short-lived threads.

    7.14.2release notes

  • File paths in the HTML report can now be searched with slashes because spacing around slashes is added with CSS.

    7.14.1release notes

  • Running a Python file through a symlink now sets sys.path correctly, matching regular Python behavior.

    7.14.0release notes

  • The C extension now builds on VS2019.

    7.13.5release notes

  • Fixed a memory leak when repeatedly using the Coverage API with in-memory data.

    7.13.5release notes

  • Special characters in file paths are now fully escaped in markdown-formatted coverage reports.

    7.13.5release notes

  • Coverage no longer fails with “RuntimeError: Set changed size during iteration” in test suites that change sys.path.

    7.13.4release notes

  • Coverage no longer raises PermissionError when a parent directory is unreadable while examining directories where coverage was run.

    7.13.4release notes

  • When a data file has no read permissions, the combine step now issues a warning and skips the file instead of failing completely.

    7.13.2release notes

  • Standard library files are no longer incorrectly included in coverage reports when Python is installed via symlinks.

    7.13.2release notes

  • Module docstrings are no longer reported as executed lines, matching the behavior of other reports.

    7.13.1release notes

  • Fixes handling of except* clauses under the sysmon measurement core, which could cause KeyError exceptions.

    7.12.0release notes

  • Defends against aggressive mocking of open() that could cause errors inside coverage.py.

    7.12.0release notes

  • Fixes failures when coverage.py tries to open source files after a test suite exhausts the system’s file descriptors.

    7.12.0release notes

  • Fixed a NotPython exception when Python code was claimed to come from a non-Python file while using the sysmon measurement core.

    7.11.2release notes

  • Fixes breakpoint() stopping one frame lower than expected when running in pytest under coverage by reverting a coverage change from v6.4.1.

    7.11.1release notes

  • Fixes incorrect claims of missing branches for some multi-line case clauses, for loops, and probably other constructs when using the sys.monitoring core.

    7.11.1release notes

  • Support for Python 3.15 alpha was declared.

    7.11.0release notes