In order to get 100% test coverage, I need to ignore some file(s) in python.
I searched the web and I found nosetests
which I don't want to use.
I also found that I can edit my .coveragerc
file and omit files and functions, when running my tests using intellij (with unittest framework), it didn't manage to use .coveragerc
file.
Any idea how to ignore / omit / exclude files during test coverage ?
How can I run the test using this file as a parameter ?
You can use this command in your .coveragerc file.
# .coveragerc
[report]
show_missing = True
omit =
junk/*
You include the path of files you want to omit under the omit command, for example, I want to omit every file in the junk folder hence my use of junk/*
.
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