-
Notifications
You must be signed in to change notification settings - Fork 211
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
tox tests + branch coverage + coverage combine = internal error #168
Comments
Ah yes, you've hit the default coverage config problem. Coveragepy is using ".coveragerc" as a magic value that means: use .coveragerc if it exists, otherwise lookup a bunch of other files for configuration. So we can't just make it an absolute path (that failing test is changing CWD btw) I guess we could provide a workaround: we make it absolute only if it's not ".coveragerc"? |
Hi @ionelmc - thanks. I don't quite understand how that workaround you proposed would work, but a workaround that works already is passing the path to the pytest-cov like:
So that works and is good enough for me at the moment. |
Actually I'm not really sure what I meant, I think I wrote that while drunk. Can we close this? |
I saw the same error message. Do you have any ideas about the cause? |
Well the cause is mismatched coverage configuration when subprocesses are used (eg: one process has branch coverage enabled while the other doesn't). If you have a reproducer I'd gladly* look at it. * if it's minimal :D |
Hi, If you're willing to take a look, the stuff is here: |
You can use |
tox.ini includes workaround for pytest-dev/pytest-cov#168
tox.ini includes workaround for pytest-dev/pytest-cov#168
tox.ini includes workaround for pytest-dev/pytest-cov#168
tox.ini includes workaround for pytest-dev/pytest-cov#168
Do we still need the workaround of passing explicitly |
Hi,
I added coverage to the tests of the tox project and stumbled over a problem when trying to record branch coverage. The problem is os independent and can be reproduced easily with the code of the tox project.
versions:
reproduce:
result:
There are a lot of timestamped .coverage.* files and all except for the first one contain "arc" data - the first one contains "lines" data - which causes the error.
I have not yet tried to reproduce this with vanilla coverage as the reason I use pytest-cov is that there are a lot of tests that run in a subprocess and pytest-cov takes care of that. It might be that the problem is actually in coverage.py itself but I thought I report this here first.
pytest tests/test_z_cmdline.py::TestToxRun --cov=tox
works.The text was updated successfully, but these errors were encountered: