-
-
Notifications
You must be signed in to change notification settings - Fork 439
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Enhancement] Allow configuration of directory where coverage loads and saves files #752
Comments
Have you tried the If you still need a separate directory, I believe you can set the data file (for example with the COVERAGE_FILE environment variable, or the |
@nedbat Thanks for the quick reply ! I tried the If only changing the COVERAGE_FILE to make them unique is good enough, then that would be fine for me. My concern here is that if I run the suite multiple times in parallel and multiple coverage instances are collating results of multiprocess tests... then uniquely named coverage files from one run will accidentally be collected by adjacent runs - I thought the easiest way to ensure this didnt happen is to just have a separate "work directory" per run. |
Can you provide some details about how you are running your tests? My point about COVERAGE_FILE was that you could do: COVERAGE_FILE=/tmp/foo1234/.coverage and use a different directory for each test run. |
I had tried this by enabling parallel in the I had not considered changing CWD for the test, this appears to work perfectly thanks ! EDIT: To elaborate on the solution with tox, I basically set |
Is your feature request related to a problem? Please describe.
I would like to run my tests multiple times in parallel, against multiple python environments, and safely collect coverage reports for each test run separately.
The program under test is using multiprocessing already, which means
coverage
will create many files for eachpytest
run already, these should be done in a separate directory.Describe the solution you'd like
It would be nice to just have a command line option or configuration or environment variable to specify a directory where coverage should read and write to/from.
Describe alternatives you've considered
Coverage could automatically create a temp directory at the beginning of the run, and associate the current process tree under test with that directory internally, cleaning it up at the end and either appending or overwriting the user specified target data file.
The text was updated successfully, but these errors were encountered: