[TIP] Test added (and executed) isn't increasing apparent coverage

Marius Gedminas marius at gedmin.as
Fri Apr 3 02:59:57 PDT 2020

On Thu, Apr 02, 2020 at 09:32:17AM -0700, Skip Montanaro wrote:
> When I run make, this section of output corresponds to running the unit tests:
>     /home/skip/.local/bin/coverage run -a --source=/home/skip/src/python/
>     cpython/Lib/rattlesnake ./Tools/scripts/run_tests.py -v test_rattlesnake
>     /home/skip/src/python/cpython/python -u -W default -bb -E -m test -r -w -j
>     0 -u all,-largefile,-audio,-gui -v test_rattlesnake

Is your run_tests.py executing 'python ... -m test ...' in a subprocess?

Have you done the necessary groundwork to enable multi-process coverage
tracking?  I think not -- I don't see '-p' passed to 'coverage run', nor
a 'coverage combine' command in your Makefile.

Do check the documentation:
- https://coverage.readthedocs.io/en/latest/subprocess.html (which
  page surprises me by not mentioning 'coverage combine', TBH)
- https://coverage.readthedocs.io/en/latest/cmd.html#combining-data-files

Marius Gedminas
If all else fails, read the documentation.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <http://lists.idyll.org/pipermail/testing-in-python/attachments/20200403/cd93d4b6/attachment.pgp>

More information about the testing-in-python mailing list