I'm developing a module1 which has some test cases. I've another module2 which can run these test cases and generate the amount of coverage. Currently the .coverage folder is generated on the current working directory from where the module2 is being called. Is there a way to specify the folder path for coverage to dump this .coverage in the path specified?
Seems like from command line there is no option to do this. But using configuration files this can be done.
In the configuration file keep below lines.
[run]
data_file = < path where .coverage should be stored >
Then run:
coverage run < script > (if configuration file is not specified, it looks for .coveragerc in same folder from when coverage is being run. If this is also not available then defaults are used)
or
coverage run --rcfile < configuration file name > < script name >
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