./devel/py-coverage, Python module that measures code coverage for Python

[ Image CVSweb ] [ Image Homepage ] [ Image RSS ] [ Image Required by ]


Branch: CURRENT, Version: 7.16.2, Package name: py313-coverage-7.16.2, Maintainer: kamel.derouiche

Python module that measures code coverage during Python execution.
It uses the code analysis tools and tracing hooks provided in
the Python standard library to determine which lines are executable,
and which have been executed.


Required to run:
[devel/py-setuptools] [databases/py-sqlite3] [lang/python37]

Required to build:
[pkgtools/cwrappers] [devel/py-test-runner]

Master sites:

Filesize: 949.218 KB

Version history: (Expand)


CVS history: (Expand)


   2026-10-03 11:12:43 by Adam Ciarcinski | Files touched by this commit (2) | Package updated
Log message:
py-coverage: updated to 7.16.2

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`_.
   2026-09-23 14:13:42 by Adam Ciarcinski | Files touched by this commit (2) | Package updated
Log message:
py-coverage: updated to 7.16.1

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 :meth:`.CoverageData.update` twice on an in-memory database would
  fail, as described in `issue 2279`_. This is now fixed.
   2026-09-02 09:30:01 by Adam Ciarcinski | Files touched by this commit (2) | Package updated
Log message:
py-coverage: updated to 7.16.0

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 :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`_).
   2026-08-07 10:20:42 by Adam Ciarcinski | Files touched by this commit (3) | Package updated
Log message:
py-coverage: updated to 7.15.4

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 <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.
   2026-07-20 14:21:56 by Adam Ciarcinski | Files touched by this commit (2) | Package updated
Log message:
py-coverage: updated to 7.15.2

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`_.
   2026-07-03 08:12:33 by Adam Ciarcinski | Files touched by this commit (2) | Package updated
Log message:
py-coverage: updated to 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 <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_>`_.
   2026-06-23 06:26:04 by Adam Ciarcinski | Files touched by this commit (2) | Package updated
Log message:
py-coverage: updated to 7.14.3

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 <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_>`_.
   2026-05-27 06:25:01 by Adam Ciarcinski | Files touched by this commit (2) | Package updated
Log message:
py-coverage: updated to 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.