Skip to content

Update coverage to 7.16.2 - #424

Open
pyup-bot wants to merge 1 commit into
masterfrom
pyup-update-coverage-7.8.0-to-7.16.2
Open

pyup-bot wants to merge 1 commit into
masterfrom
pyup-update-coverage-7.8.0-to-7.16.2

Conversation

@pyup-bot

Copy link
Copy Markdown
Collaborator

This PR updates coverage from 7.8.0 to 7.16.2.

Changelog

7.16.2

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

- 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
fixed, closing `issue 2168`_.

- Fix: on Python 3.14 and later, the ``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`_.

- Fix: with ``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`_.

.. _issue 1923: https://github.com/coveragepy/coveragepy/issues/1923
.. _issue 2168: https://github.com/coveragepy/coveragepy/issues/2168
.. _issue 2289: https://github.com/coveragepy/coveragepy/issues/2289


.. _changes_7-16-1:

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 :meth:`.CoverageData.update` twice on an in-memory database would
fail, as described in `issue 2279`_. This is now fixed.

.. _issue 1563: https://github.com/coveragepy/coveragepy/issues/1563
.. _pull 2269: https://github.com/coveragepy/coveragepy/pull/2269
.. _issue 2279: https://github.com/coveragepy/coveragepy/issues/2279

.. _changes_7-16-0:

7.16.0

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

- 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 :meth:`.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`_).

.. _pull 2261: https://github.com/coveragepy/coveragepy/pull/2261
.. _pull 2262: https://github.com/coveragepy/coveragepy/pull/2262
.. _pull 2263: https://github.com/coveragepy/coveragepy/pull/2263
.. _pull 2265: https://github.com/coveragepy/coveragepy/pull/2265
.. _issue 2266: https://github.com/coveragepy/coveragepy/issues/2266
.. _pull 2268: https://github.com/coveragepy/coveragepy/pull/2268
.. _pull 2270: https://github.com/coveragepy/coveragepy/pull/2270


.. _changes_7-15-4:

7.15.4

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

- 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 <pull 2227_>`_.

- 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 <pull
2226_>`_.

- Wheels are now provided for Python 3.15.

.. _pull 2226: https://github.com/coveragepy/coveragepy/pull/2226
.. _pull 2227: https://github.com/coveragepy/coveragepy/pull/2227


.. _changes_7-15-3:

7.15.3

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

- 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 <pull 2234_>`_.
Closes `issue 2200`_.

- A performance improvement in the low-level line number bookkeeping when
combining data files, thanks to `Kevin Turcios <pull 2239_>`_.

- Performance improvement in HTML reporting by reducing the number of times
files have to be parsed, thanks to `Kevin Turcios <pull 2240_>`_.

.. _issue 2200: https://github.com/coveragepy/coveragepy/issues/2200
.. _pull 2234: https://github.com/coveragepy/coveragepy/pull/2234
.. _pull 2239: https://github.com/coveragepy/coveragepy/pull/2239
.. _pull 2240: https://github.com/coveragepy/coveragepy/pull/2240


.. _changes_7-15-2:

7.15.2

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

- 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`_.

.. _issue 2229:  https://github.com/coveragepy/coveragepy/issues/2229


.. _changes_7-15-1:

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 <pull 2224_>`_.

- A number of performance improvements thanks to Paul Kehrer, in pull requests
`2213 <pull 2213_>`_, `2214 <pull 2214_>`_, `2215 <pull 2215_>`_, `2216
<pull 2216_>`_, `2218 <pull 2218_>`_, `2220 <pull 2220_>`_, and `2221 <pull
2221_>`_.

.. _pull 2213: https://github.com/coveragepy/coveragepy/pull/2213
.. _pull 2214: https://github.com/coveragepy/coveragepy/pull/2214
.. _pull 2215: https://github.com/coveragepy/coveragepy/pull/2215
.. _pull 2216: https://github.com/coveragepy/coveragepy/pull/2216
.. _pull 2218: https://github.com/coveragepy/coveragepy/pull/2218
.. _pull 2220: https://github.com/coveragepy/coveragepy/pull/2220
.. _pull 2221: https://github.com/coveragepy/coveragepy/pull/2221
.. _pull 2224: https://github.com/coveragepy/coveragepy/pull/2224

.. _changes_7-15-0:

7.15.0

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

- 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 <pull 2206_>`_.

- When running your program, coverage now correctly sets
``yourmodule.__spec__.loader`` as `strongly recommended <--loader--_>`_,
avoiding the deprecation warning described in `issue 2208`_. Thanks, `A5rocks
<pull 2209_>`_.

- 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 <pull
2211_>`_.

.. _--loader--: https://docs.python.org/3/reference/datamodel.html#module.__loader__
.. _issue 2103:  https://github.com/coveragepy/coveragepy/issues/2103
.. _issue 2198:  https://github.com/coveragepy/coveragepy/issues/2198
.. _issue 2205:  https://github.com/coveragepy/coveragepy/issues/2205
.. _pull 2206: https://github.com/coveragepy/coveragepy/pull/2206
.. _issue 2208:  https://github.com/coveragepy/coveragepy/issues/2208
.. _pull 2209: https://github.com/coveragepy/coveragepy/pull/2209
.. _pull 2211: https://github.com/coveragepy/coveragepy/pull/2211


.. _changes_7-14-3:

7.14.3

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

- 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 <pull 2196_>`_.

- 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 <pull 2203_>`_.

.. _issue 2185: https://github.com/coveragepy/coveragepy/issues/2185
.. _pull 2196: https://github.com/coveragepy/coveragepy/pull/2196
.. _pull 2203: https://github.com/coveragepy/coveragepy/pull/2203


.. _changes_7-14-2:

7.14.2

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

- 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 <pull 2193_>`_.

- 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 <no-13t_>`_, we no longer distribute
wheels for Python 3.13 free-threaded.

.. _issue 2187: https://github.com/coveragepy/coveragepy/issues/2187
.. _issue 2192: https://github.com/coveragepy/coveragepy/issues/2192
.. _pull 2193: https://github.com/coveragepy/coveragepy/pull/2193
.. _issue 2197: https://github.com/coveragepy/coveragepy/issues/2197
.. _no-13t: https://py-free-threading.github.io/ci/#building-free-threaded-wheels-with-cibuildwheel


.. _changes_7-14-1:

7.14.1

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

- 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 <hugo-316_>`_ since we test on the 3.16 main
branch.

.. _issue 2170: https://github.com/coveragepy/coveragepy/issues/2170
.. _hugo-316: https://mastodon.social/hugovk/116588523571204490


.. _changes_7-14-0:

7.14.0

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

- Feature: now when running one of the reporting commands, if there are
parallel data files that need combining, they will be implicitly combined
before creating the report. There is no option to avoid the combination; let
us know if you have a use case that requires it.  Thanks, `Tim Hatch
<pull 2162_>`_. Closes `issue 1781`_.

- Fix: the output from ``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.

- Fix: running a Python file through a symlink now sets the sys.path correctly,
matching regular Python behavior. Fixes `issue 2157`_.

- Fix: ``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 <pull
2165_>`_.

- Fix: the soft keyword ``lazy`` is now bolded in HTML reports.

- We are no longer testing eventlet support. Eventlet started issuing stern
deprecation warnings that break our tests. Our support code is still there.

.. _issue 1781: https://github.com/coveragepy/coveragepy/issues/1781
.. _issue 2157: https://github.com/coveragepy/coveragepy/issues/2157
.. _pull 2162: https://github.com/coveragepy/coveragepy/pull/2162
.. _pull 2165: https://github.com/coveragepy/coveragepy/pull/2165


.. _changes_7-13-5:

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
<pull 2142_>`_.

- Fix: the C extension wouldn't build on VS2019, but now it does (`issue
2145`_).

.. _issue 2138: https://github.com/coveragepy/coveragepy/issues/2138
.. _issue 2141: https://github.com/coveragepy/coveragepy/issues/2141
.. _pull 2142: https://github.com/coveragepy/coveragepy/pull/2142
.. _issue 2145: https://github.com/coveragepy/coveragepy/issues/2145


.. _changes_7-13-4:

7.13.4

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

- 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
parent directories is unreadable, a PermissionError would occur, as
described in `issue 2129`_. This is now fixed.

- Fix: in test suites that change sys.path, coverage.py could fail with
"RuntimeError: Set changed size during iteration" as described and fixed in
`pull 2130`_. Thanks, Noah Fatsi.

- We now publish ppc64le wheels, thanks to `Pankhudi Jain <pull 2121_>`_.

.. _pull 2121: https://github.com/coveragepy/coveragepy/pull/2121
.. _issue 2129: https://github.com/coveragepy/coveragepy/issues/2129
.. _pull 2130: https://github.com/coveragepy/coveragepy/pull/2130


.. _changes_7-13-3:

7.13.3

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

- Fix: in some situations, third-party code was measured when it shouldn't have
been, slowing down test execution. This happened with layered virtual
environments such as uv sometimes makes. The problem is fixed, closing `issue
2082`_. Now any directory on sys.path that is inside a virtualenv is
considered third-party code.

.. _issue 2082: https://github.com/coveragepy/coveragepy/issues/2082


.. _changes_7-13-2:

7.13.2

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

- Fix: when Python is installed via symlinks, for example with Homebrew, the
standard library files could be incorrectly included in coverage reports.
This is now fixed, closing `issue 2115`_.

- Fix: if a data file is created with no read permissions, the combine step
would fail completely. Now a warning is issued and the file is skipped.
Closes `issue 2117`_.

.. _issue 2115: https://github.com/coveragepy/coveragepy/issues/2115
.. _issue 2117: https://github.com/coveragepy/coveragepy/issues/2117


.. _changes_7-13-1:

7.13.1

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

- 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
`issue 2110`_.

- Added: The ``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.

- Fix: the JSON report used to report module docstrings as executed lines,
which no other report did, as described in `issue 2105`_. This is now fixed,
thanks to Jianrong Zhao.

- Fix: coverage.py uses a more disciplined approach to detecting where
third-party code is installed, and avoids measuring it. This shouldn't change
any behavior. If you find that it does, please get in touch.

- Performance: data files that will be combined now record their hash as part
of the file name. This lets us skip duplicate data more quickly, speeding the
combining step.

- Docs: added a section explaining more about what is considered a missing
branch and how it is reported: :ref:`branch_explain`, as requested in `issue
1597`_. Thanks to `Ayisha Mohammed <pull 2092_>`_.

- Tests: the test suite misunderstood what core was being tested if
``COVERAGE_CORE`` wasn't set on 3.14+. This is now fixed, closing `issue
2109`_.

.. _issue 1597: https://github.com/coveragepy/coveragepy/issues/1597
.. _pull 2092: https://github.com/coveragepy/coveragepy/pull/2092
.. _issue 2105: https://github.com/coveragepy/coveragepy/issues/2105
.. _issue 2109: https://github.com/coveragepy/coveragepy/issues/2109
.. _issue 2110: https://github.com/coveragepy/coveragepy/issues/2110


.. _changes_7-13-0:

7.13.0

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

- Feature: coverage.py now supports :file:`.coveragerc.toml` configuration
files. These files use TOML syntax and take priority over
:file:`pyproject.toml` but lower priority than :file:`.coveragerc` files.
Closes `issue 1643`_ thanks to `Olena Yefymenko <pull 1952_>`_.

- Fix: we now include a permanent .pth file which is installed with the code,
fixing `issue 2084`_.  In 7.12.1b1 this was done incorrectly: it didn't work
when using the source wheel (``py3-none-any``).  This is now fixed. Thanks,
`Henry Schreiner <pull 2100_>`_.

- Deprecated: when coverage.py is installed, it creates three command entry
points: ``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.

.. _issue 1643: https://github.com/coveragepy/coveragepy/issues/1643
.. _pull 1952: https://github.com/coveragepy/coveragepy/pull/1952
.. _pull 2100: https://github.com/coveragepy/coveragepy/pull/2100


.. _changes_7-12-1b1:

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.

.. _issue 2084: https://github.com/coveragepy/coveragepy/issues/2084


.. _changes_7-12-0:

7.12.0

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

- The HTML report now shows separate coverage totals for statements and
branches, as well as the usual combined coverage percentage. Thanks to Ryuta
Otsuka for the `discussion <issue 2081_>`_ and the `implementation
<pull 2085_>`_.

- The JSON report now includes separate coverage totals for statements and
branches, thanks to `Ryuta Otsuka <pull 2090_>`_.

- Fix: ``except*`` clauses were not handled properly under the "sysmon"
measurement core, causing KeyError exceptions as described in `issue 2086`_.
This is now fixed.

- Fix: we now defend against aggressive mocking of ``open()`` that could cause
errors inside coverage.py.  An example of a failure is in `issue 2083`_.

- Fix: in unusual cases where a test suite intentionally exhausts the system's
file descriptors to test handling errors in ``open()``, coverage.py would
fail when trying to open source files, as described in `issue 2091`_.  This
is now fixed.

- A small tweak to the HTML report: file paths now use thin spaces around
slashes to make them easier to read.

.. _issue 2081: https://github.com/coveragepy/coveragepy/issues/2081
.. _issue 2083: https://github.com/coveragepy/coveragepy/issues/2083
.. _pull 2085: https://github.com/coveragepy/coveragepy/pull/2085
.. _issue 2086: https://github.com/coveragepy/coveragepy/issues/2086
.. _pull 2090: https://github.com/coveragepy/coveragepy/pull/2090
.. _issue 2091: https://github.com/coveragepy/coveragepy/issues/2091


.. _changes_7-11-3:

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.

.. _issue 2076: https://github.com/coveragepy/coveragepy/issues/2076
.. _issue 2078: https://github.com/coveragepy/coveragepy/issues/2078
.. _nedbat GitHub account: https://github.com/nedbat
.. _coveragepy GitHub organization: https://github.com/coveragepy


.. _changes_7-11-2:

7.11.2

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

- 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. This could happen for example with Jinja templates compiled to
Python, as reported in `issue 2077`_. This is now fixed.

- Doc: corrected the first entry in the 7.11.1 changelog.

.. _issue 2077: https://github.com/coveragepy/coveragepy/issues/2077


.. _changes_7-11-1:

7.11.1

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

- 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 some
concurrency settings, with dynamic context, and in Python 3.12/3.13, with
branch measurement.

- If the core is not specified and defaults to "sysmon" (Python 3.14+), but
 other settings conflict with sysmon, then the "ctrace" core will be used
 instead with no warning. For concurrency conflicts, this used to produce an
 error, as described in `issue 2064`_.

- If the "sysmon" core is explicitly requested in your configuration, but
 other settings conflict, an error is now raised. This used to produce a
 warning.

- Fix: some multi-line case clauses or for loops (and probably other
constructs) could cause incorrect claims of missing branches with the
sys.monitoring core, as described in `issue 2070`_. This is now fixed.

- Fix: when running in pytest under coverage, a ``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.

- A new debug option ``--debug=core`` shows which core is in use and why.

- Split ``sqlite`` debugging information out of the ``sys`` :ref:`coverage
debug <cmd_debug>` and :ref:`cmd_run_debug` options since it's bulky and not
very useful.

- Updated the :ref:`howitworks` page to better describe the three different
measurement cores.

.. _issue 1420: https://github.com/coveragepy/coveragepy/issues/1420
.. _issue 2064: https://github.com/coveragepy/coveragepy/issues/2064
.. _issue 2070: https://github.com/coveragepy/coveragepy/issues/2070


.. _changes_7-11-0:

7.11.0

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

- Dropped support for Python 3.9, declared support for Python 3.15 alpha.


.. _changes_7-10-7:

7.10.7

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

- Performance: with branch coverage in large files, generating HTML, JSON, or
LCOV reports could take far too long due to some quadratic behavior when
creating the function and class index pages.  This is now fixed, closing
`issue 2048`_.  Thanks to Daniel Diniz for help diagnosing the problem.

- Most warnings and a few errors now have links to a page in the docs
explaining the specific message.  Closes `issue 1921`_.

.. _issue 1921: https://github.com/coveragepy/coveragepy/issues/1921
.. _issue 2048: https://github.com/coveragepy/coveragepy/issues/2048


.. _changes_7-10-6:

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 <pull 2038_>`_ the speed of
combination, especially with many contexts.

.. _issue 1499: https://github.com/coveragepy/coveragepy/issues/1499
.. _pull 2038: https://github.com/coveragepy/coveragepy/pull/2038


.. _changes_7-10-5:

7.10.5

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

- Big speed improvements for ``coverage combine``: it's now about twice as
fast! Huge thanks to Alex Gaynor for pull requests `2032 <pull 2032_>`_,
`2033 <pull 2033_>`_, and `2034 <pull 2034_>`_.

.. _pull 2032: https://github.com/coveragepy/coveragepy/pull/2032
.. _pull 2033: https://github.com/coveragepy/coveragepy/pull/2033
.. _pull 2034: https://github.com/coveragepy/coveragepy/pull/2034


.. _changes_7-10-4:

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.


.. _changes_7-10-3:

7.10.3

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

- Fixes for ``patch = subprocess``:

- If subprocesses spawned yet more subprocesses simultaneously, some coverage
 could be missed.  This is now fixed, closing `issue 2024`_.

- If subprocesses were created in other directories, their data files were
 stranded there and not combined into the totals, as described in `issue
 2025`_.  This is now fixed.

- On Windows (or maybe only some Windows?) the patch would fail with a
 ``ModuleNotFound`` error trying to import coverage.  This is now fixed,
 closing `issue 2022`_.

- Originally only options set in the coverage configuration file would apply
 to subprocesses.  Options set on the ``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.

- Added ``debug=patch`` to help diagnose problems.

- Fix: really close all SQLite databases, even in-memory ones. Closes `issue
2017`_.

.. _issue 2017: https://github.com/coveragepy/coveragepy/issues/2017
.. _issue 2021: https://github.com/coveragepy/coveragepy/issues/2021
.. _issue 2022: https://github.com/coveragepy/coveragepy/issues/2022
.. _issue 2024: https://github.com/coveragepy/coveragepy/issues/2024
.. _issue 2025: https://github.com/coveragepy/coveragepy/issues/2025


.. _changes_7-10-2:

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.

.. _issue 1999: https://github.com/coveragepy/coveragepy/issues/1999


.. _changes_7-10-1:

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`_.

.. _issue 2006: https://github.com/coveragepy/coveragepy/issues/2006


.. _changes_7-10-0:

7.10.0

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

- A new configuration option: ":ref:`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 :func:`os._exit()
 <python: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 :mod:`subprocess`, :func:`os.system`, or one of the :func:`execv
 <python:os.execl>` or :func:`spawnv <python:os.spawnl>` family of
 functions. Closes old `issue 367`_, its duplicate `issue 378`_ and old
 `issue 689`_.

- ``patch = execv`` adjusts the :func:`execv <python: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!

- 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 <pull 1998_>`_.

- A new configuration option: ":ref:`config_report_partial_also`" is a list of
regexes to add as pragmas for partial branches.  This parallels the
":ref:`config_report_exclude_also`" setting for adding line exclusion
patterns.

- A few file path configuration settings didn't allow for tilde expansion:
:ref:`config_json_output`, :ref:`config_lcov_output` and
:ref:`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`_.

.. _issue 43: https://github.com/coveragepy/coveragepy/issues/43
.. _issue 310: https://github.com/coveragepy/coveragepy/issues/310
.. _issue 312: https://github.com/coveragepy/coveragepy/issues/312
.. _issue 367: https://github.com/coveragepy/coveragepy/issues/367
.. _issue 378: https://github.com/coveragepy/coveragepy/issues/378
.. _issue 689: https://github.com/coveragepy/coveragepy/issues/689
.. _issue 831: https://github.com/coveragepy/coveragepy/issues/831
.. _issue 1308: https://github.com/coveragepy/coveragepy/issues/1308
.. _issue 1673: https://github.com/coveragepy/coveragepy/issues/1673
.. _issue 1845: https://github.com/coveragepy/coveragepy/issues/1845
.. _issue 1941: https://github.com/coveragepy/coveragepy/issues/1941
.. _pull 1998: https://github.com/coveragepy/coveragepy/pull/1998
.. _issue 2001: https://github.com/coveragepy/coveragepy/issues/2001
.. _issue 2005: https://github.com/coveragepy/coveragepy/issues/2005

.. _changes_7-9-2:

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 <pull 1984_>`_.

.. _pull 1984: https://github.com/coveragepy/coveragepy/pull/1984
.. _issue 1991: https://github.com/coveragepy/coveragepy/issues/1991


.. _changes_7-9-1:

7.9.1

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

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

- On Python 3.14+, the "sysmon" core is now the default if it's supported for
your configuration.  Plugins and dynamic contexts are still not supported
with it.


.. _changes_7-9-0:

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 <pull 1978_>`_.

- Fixed a "ValueError: min() arg is an empty sequence" error caused by strange
empty modules, found by `oss-fuzz`_.

.. _issue 1746: https://github.com/coveragepy/coveragepy/issues/1746
.. _issue 1977: https://github.com/coveragepy/coveragepy/issues/1977
.. _pull 1978: https://github.com/coveragepy/coveragepy/pull/1978
.. _issue 1980: https://github.com/coveragepy/coveragepy/issues/1980
.. _PEP 489: https://peps.python.org/pep-0489
.. _oss-fuzz: https://google.github.io/oss-fuzz/


.. _changes_7-8-2:

7.8.2

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

- Wheels are provided for Windows ARM64 on Python 3.11, 3.12, and 3.13.
Thanks, `Finn Womack <pull 1972_>`_.

.. _issue 1971: https://github.com/coveragepy/coveragepy/pull/1971
.. _pull 1972: https://github.com/coveragepy/coveragepy/pull/1972

.. _changes_7-8-1:

7.8.1

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

- A number of EncodingWarnings were fixed that could appear if you've enabled
PYTHONWARNDEFAULTENCODING, fixing `issue 1966`_.  Thanks, `Henry Schreiner
<pull 1967_>`_.

- Fixed a race condition when using sys.monitoring with free-threading Python,
closing `issue 1970`_.

.. _issue 1966: https://github.com/coveragepy/coveragepy/issues/1966
.. _pull 1967: https://github.com/coveragepy/coveragepy/pull/1967
.. _issue 1970: https://github.com/coveragepy/coveragepy/issues/1970

.. _changes_7-8-0:
Links

This branch has not been deployed

No deployments
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