Skip to content

Releases: coveragepy/coveragepy

7.16.1

Choose a tag to compare

@nedbat nedbat released this 13 Sep 19:13
7.16.1

Version 7.16.1 — 2026-09-13

  • 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.

➡️  PyPI page: coverage 7.16.1.
➡️  To install: python3 -m pip install coverage==7.16.1

7.16.0

Choose a tag to compare

@nedbat nedbat released this 28 Aug 21:56
7.16.0

Version 7.16.0 — 2026-08-28

  • When combining files, now path separator slashes will automatically be converted to the local file system style. This makes it less necessary to define [paths] configuration to combine data across operating systems. Fixes issue 2266.
  • The Coverage.switch_context() method now returns the previous context.
  • Fix: previously, a [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.
  • Fixes to validation of options and configuration settings:
    • Negative precision settings now always cause useful error messages (pull 2261).
    • An invalid regex in the --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).
    • Non-string values in TOML configuration settings now produce a helpful error message instead of a traceback. This affects list settings whose elements aren’t strings (like 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).
  • Fix: 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

7.15.4

Choose a tag to compare

@nedbat nedbat released this 06 Aug 15:06
7.15.4

Version 7.15.4 — 2026-08-06

  • 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 and prev/next links, so it could close the attribute early and inject markup. Page URLs are now escaped. Thanks, Rajath Mohare.
  • Fix: the LCOV report wrote file names and other fields into its line-oriented records without neutralizing control characters. A measured file whose name contained a newline (legal on POSIX) could forge extra records, inflating the coverage seen by tools that read the report. Control characters in a field are now replaced. Thanks, Rajath Mohare.
  • Wheels are now provided for Python 3.15.

➡️  PyPI page: coverage 7.15.4.
➡️  To install: python3 -m pip install coverage==7.15.4

7.15.3

Choose a tag to compare

@nedbat nedbat released this 02 Aug 18:54
7.15.3

Version 7.15.3 — 2026-08-02

  • Fix: the sysmon core is incompatible with dynamic contexts. Previously, the combination would be prevented when read from the coverage.py configuration. But using the context API as pytest-cov does, contexts would be silently dropped. Now a warning is issued, thanks to Jisang Han. Closes issue 2200.
  • A performance improvement in the low-level line number bookkeeping when combining data files, thanks to Kevin Turcios.
  • Performance improvement in HTML reporting by reducing the number of times files have to be parsed, thanks to Kevin Turcios.

➡️  PyPI page: coverage 7.15.3.
➡️  To install: python3 -m pip install coverage==7.15.3

7.15.2

Choose a tag to compare

@nedbat nedbat released this 15 Jul 18:57
7.15.2

Version 7.15.2 — 2026-07-15

  • 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 different approach that is both faster and slimmer than 7.15.0. Fixes issue 2229.

➡️  PyPI page: coverage 7.15.2.
➡️  To install: python3 -m pip install coverage==7.15.2

7.15.1

Choose a tag to compare

@nedbat nedbat released this 12 Jul 20:59
7.15.1

Version 7.15.1 — 2026-07-12

  • 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.

➡️  PyPI page: coverage 7.15.1.
➡️  To install: python3 -m pip install coverage==7.15.1

7.15.0

Choose a tag to compare

@nedbat nedbat released this 02 Jul 13:14
7.15.0

Version 7.15.0 — 2026-07-02

  • Since 7.14.0, reporting commands implicitly combine parallel data files. Now those commands have a new option --keep-combined to retain the data files after combining them instead of the default, which is to delete them. Finishes issue 2198.
  • Fix: the LCOV report would incorrectly count excluded functions as uncovered, as described in issue 2205. This is now fixed thanks to Martin Kuntz Jacobsen.
  • When running your program, coverage now correctly sets yourmodule.__spec__.loader as strongly recommended, avoiding the deprecation warning described in issue 2208. Thanks, A5rocks.
  • Fix: with Python 3.10, running with the -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

7.14.3

Choose a tag to compare

@nedbat nedbat released this 22 Jun 23:12
7.14.3

Version 7.14.3 — 2026-06-22

  • 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 -> dict[ ... ] annotation that a formatter has split over multiple lines). Closes issue 2185, thanks Mengjia Shang.
  • Fix: On 3.13t, we incorrectly issued 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

7.14.2

Choose a tag to compare

@nedbat nedbat released this 20 Jun 14:49
7.14.2

Version 7.14.2 — 2026-06-20

  • Fix: some messages were being written to stdout, making coverage json -o - useless for capturing JSON output. Now messages are written to stderr, fixing issue 2197.
  • Fix: 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.
  • Fix: when using sys.monitoring, we were assuming we could use the 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.
  • Following the advice of cibuildwheel, we no longer distribute wheels for Python 3.13 free-threaded.

➡️  PyPI page: coverage 7.14.2.
➡️  To install: python3 -m pip install coverage==7.14.2

7.14.1

Choose a tag to compare

@nedbat nedbat released this 26 May 20:46
7.14.1

Version 7.14.1 — 2026-05-26

  • Fix: the HTML report used typographic niceties to make file paths more readable by adding a small amount of space around slashes. Those spaces interfered with searching the page for file paths of interest. Now the report uses CSS to accomplish the same visual tweak so that searches with slashes work correctly. Closes issue 2170.
  • Add a 3.16 PyPI classifier since we test on the 3.16 main branch.

➡️  PyPI page: coverage 7.14.1.
➡️  To install: python3 -m pip install coverage==7.14.1