-
Notifications
You must be signed in to change notification settings - Fork 211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
--cov don't include recursively folders and files #499
Comments
What sort of installation method does your project have? Perhaps a reproducer in a repository would clarify this problem. |
Sorry I missed your message 😅 I use pipenv, FastAPI and pytest (pytest, pytest-describe, pytest-cov and pytest-mock). My project have this kind of architecture:
I launch my tests with this command: |
Not sure what's going on there but you might want to copy some of the configuration here: https://github.com/pytest-dev/pytest-cov/tree/master/examples Or post a reproducer... |
This is a limitation of coverage.py - as soon as it discovers a directory without an The module structure is still valid, as recent Python versions do not require you to provide (empty) |
Thanks for your answer, indeed I have no I found a similar issue nedbat/coveragepy#1024 on the nedbat/coveragepy repo. I will continue to indicate my folder manually. |
@ionelmc |
Do I understand this thread correctly that the only way to make it work is to add |
There seems to be an option for this now: https://coverage.readthedocs.io/en/7.0.0/config.html#report-include-namespace-packages |
Amazing, this does indeed what I wanted, thanks! |
Summary
Expected vs actual result
I want to integrate all the python files in from my
src
folder only, even the untested ones.I managed to get the expected result by indicating all the folders of my project (see Config), but it is not very practical ...
I also tried with
--cov
or--cov .
but I get the same result.Actual
Expected
Reproducer
Command
Versions
Python 3.7.9
pytest 6.2.5
Config
Expected
Actual
The text was updated successfully, but these errors were encountered: