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 >
Provide path to Coverage to dump .coverage