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
Coverage(data_file=None) different behaviour (v5.0b1) #871
Comments
Using How are you using the Coverage object? Something else must also be a little different to have stopped a data file from being created. Also, can you say more about your use-case? Why is it important to not have a data file? |
We have one coverage instance and we call
After i run the script above i would expect output: When i uncomment last line, i get also this error:
Important thing to note is that when i dont use |
@nedbat the use case is pytest-testmon. For conceptual discussion how to merge some of the goals/efforts with coverage 5.0: #774 For now. Would it be difficult to allow using coverage.Coverage as before? With as little overhead as possible when doing these operations:
This has to be called for each test, so ideally it wouldn't have any expensive operation (like saving a file or creating tables in sqlite.)... |
@tarpas I can look into making that work. Though I wonder if it would work for you to make a new Coverage object each time. I don't think that will add overhead, will it? |
You say the database is created at the start of the process, so I guess when creating Coverage object. Doing it once is fine, of course, but for each unit test, it feels quite a lot of unnecessary overhead. But I didn't measure.. |
To install the branch, use:
|
Thanks, we'll try tomorrow in the morning. |
@nedbat I tested it and it works as expected. |
Thanks. I've merged (and deleted) the branch. |
This was released as part of 5.0b2 today. |
Thank you for info. |
Describe the bug
In coverage 4.* versions, when i used
Coverage(data_file=None)
, DB file was not created. It seems to be not case in 5.0b1 version. Is there a way how to not create DB file in this new version?The text was updated successfully, but these errors were encountered: