summaryrefslogtreecommitdiff
path: root/doc/migrating.rst
blob: 5bbc1f3307c53599ff1116e97a7812e832a00952 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
.. Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
.. For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt

.. _migrating:

==========================
Migrating between versions
==========================

New versions of coverage.py or Python might require you to adjust your
settings, options, or other aspects how you use coverage.py.  This page details
those changes.

.. _migrating_cov7:

Migrating to coverage.py 7.x
----------------------------

Consider these changes when migrating to coverage.py 7.x:

- The way that wildcards when specifying file paths work in certain cases has
  changed in 7.x:

  - Previously, ``*`` would incorrectly match directory separators, making
    precise matching difficult. Patterns such as ``*tests/*``
    will need to be changed to ``*/tests/*``.

  - ``**`` now matches any number of nested directories. If you wish to retain
    the behavior of ``**/tests/*`` in previous versions then  ``*/**/tests/*``
    can be used instead.

- When remapping file paths with ``[paths]``, a path will be remapped only if
  the resulting path exists. Ensure that remapped ``[paths]`` exist when
  upgrading as this is now being enforced.

- The :ref:`config_report_exclude_also` setting is new in 7.2.0.  It adds
  exclusion regexes while keeping the default built-in set. It's better than
  the older :ref:`config_report_exclude_lines` setting, which overwrote the
  entire list.  Newer versions of coverage.py will be adding to the default set
  of exclusions.  Using ``exclude_also`` will let you benefit from those
  updates.