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

Ned Batchelder ned at nedbatchelder.com
Fri Jan 4 08:59:24 PST 2019


Joe, since you have specified "--source=.", coverage will search your 
tree for importable Python files, and report on them even if they are 
never imported.  So you are already doing the right thing. I'm not sure 
why it wouldn't show you that file.  Are you sure you are running the 
commands you showed?

--Ned.

On 1/4/19 11:42 AM, Bruno Oliveira wrote:
> Hi Joe,
>
> On Fri, Dec 21, 2018 at 5:06 PM DZIOBEK, JOE <jd5948 at att.com 
> <mailto:jd5948 at att.com>> wrote:
>
>     Is there a way to have this file included in the report?
>
>
> You are not seeing coverage information for scriptB.py not because it 
> does not have an associated test file, but because it was never 
> imported during the run (I'm assuming).
>
> One way to have it to appear on the report is to import scriptB on 
> your __init__.py file, this way its coverage will be tracked.
>
> Hope this helps,
> Bruno
>
> _______________________________________________
> testing-in-python mailing list
> testing-in-python at lists.idyll.org
> http://lists.idyll.org/listinfo/testing-in-python
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.idyll.org/pipermail/testing-in-python/attachments/20190104/a97bb8ae/attachment.htm>


More information about the testing-in-python mailing list