-
-
Notifications
You must be signed in to change notification settings - Fork 433
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
CoverageSqliteData.filename gets mutated with suffix #708
Comments
My understanding is that the changed behavior in pytest-cov==2.6.0 also happens with coverage.py 4.5.1, so I don't think the SQLite storage code is part of the cause. |
Yes, that's correct. IIRC I've looked into changing pytest-cov with regard to the new API (not really feasible, since coveragepy 4 should be supported of course). As for pytest-django, where I've noticed and debugged this with I've gone with coveragepy directly now (pytest-dev/pytest-django@c72b10a). |
To be honest, I would rather change |
The use case is combining (see pytest-dev/pytest-cov#226 - pytest-cov uses a separate Coverage instance just for having an unmodified When looking into this I've tried to create Instead I think Lines 685 to 689 in 6c14ffb
The problem currently is that Lines 711 to 712 in 6c14ffb
|
Heh, I ask for an example, and you show me my own code! :) I'd like to write a failing test case for this. It seems like the scenario is: use a Coverage object with parallel=true to run some code, then try to use that same object to combine, and it won't find all the data files? I'm not sure that's a reasonable use case for the API, but help me understand. |
Yes, that't the use case.. :) |
I added a failing test to show the problem. It passes with the JSON storage, and fails with SQLite. I'm not entirely convinced this is an important case to keep working, but it shouldn't be hard to fix either. |
This is fixed in fdaf035 |
While
CoverageJsonData.filename
will be kept as the initial basename,CoverageSqliteData.filename
gets mutated with the suffix appended.This is relevant for when using
combine()
on an already used Coverage object, where the suffix is included in the glob pattern then already when looking for files to combine.This appears to be (one of) the reason(s) for pytest-cov to have a separate Coverage object for this (https://github.com/pytest-dev/pytest-cov/blob/7205428bfb9ab9f8dbcaeefe23ce5fe426bb06b9/src/pytest_cov/engine.py#L152-L155).
The text was updated successfully, but these errors were encountered: