I have a .coveragerc
file in the root of my project. It tells coverage.py to omit my project's migrations directories:
[run] omit = *migrations*
When I run coverage.py
at the command line, the config I put in .coveragerc is obeyed.
However, PyCharm does not recognize it. Is there a setting that I'm missing?
If it turns out there's no way for PyCharm to recognize .coveragerc
, I'd be happy with even just a way to omit those directories.
Increase coverage by adding more tests The code coverage has increased to 78% on adding another test case. It can be increased further to 100% in a similar fashion.
That exact # pragma: no cover is the hint that the part of code should be ignored by the tool -- see Excluding code from coverage .
You can make PyCharm use the .coveragerc
by putting it into the working directory you run your tests from.
The feature request from https://youtrack.jetbrains.com/issue/PY-16945 was implemented and works in version 2018.1.
There is a feature request for this at https://youtrack.jetbrains.com/issue/PY-16945
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With