[TIP] Can pytest identify python code that has no test

DZIOBEK, JOE jd5948 at att.com
Fri Dec 21 11:02:46 PST 2018


I have a root folder which has a
script.py & test_script.py

Then a subfolder which has
    scriptA.py & test_scriptA.py & __init__.py
    & scriptB.py ( which does not have an associated test script! )

When I run my tox/pytest/coverage report - I want to also list scriptB.py with 0% coverage,
But scriptB.py is not listed, see below.
Is there a way to have this file included in the report?

This is my tox.ini file:
commands =
    coverage run -m --source=. pytest  --ignore=.tox
    coverage report -m --omit=.tox/*

This is the coverage report
subfolder/__init__.py           0      0   100%
subfolder/scriptA.py            2      0   100%
subfolder/test_scriptA.py       3      0   100%
script.py                       4      1    75%   3
test_script.py                  3      0   100%
----------------------------------------------------
TOTAL                          12      1    92%

Regards - Joe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.idyll.org/pipermail/testing-in-python/attachments/20181221/ad6ecbb8/attachment.html>


More information about the testing-in-python mailing list