I am having problem on testing my django application. It passes all the tests but coverage.py doesn't give any report about the coverage. Any luck on this? Thanks
Asked
Active
Viewed 8,875 times
7
-
1What is the command you used to run your tests with coverage? – Derek Kwok Feb 03 '16 at 04:59
-
http://stackoverflow.com/questions/18573542/coverage-py-does-not-cover-script-if-py-test-executes-it-from-another-directory – hussain Feb 03 '16 at 05:04
-
I used coverage run --source='.' manage.py test – Andie Rabino Feb 03 '16 at 06:18
-
Does this answer your question? [Coverage.py warning: No data was collected. (no-data-collected)](https://stackoverflow.com/questions/47287721/coverage-py-warning-no-data-was-collected-no-data-collected) – louis_guitton Mar 07 '20 at 15:29
1 Answers
5
The coverage docs say the following:
“No data was collected (no-data-collected)”
Coverage.py ran your program, but didn’t measure any lines as executed. This could be because you asked to measure only modules that never ran, or for other reasons.
That means that your config needs some tweaking. In my case I forgot to glob the directory I specified in my .coveragerc
:
[run]
include = my_app/*
Have a look at the command you're running the tests with and your config files. There may be some directives working against each other.

jnns
- 5,148
- 4
- 47
- 74