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
CoverageException: Can't add file tracer data for unmeasured file #69
Comments
I've also run into this problem with the exact same configuration you're talking about 👍 |
An interesting bug report, thanks! There are a few things going on here. If I add the
Pytest normally captures all the output, so you couldn't see this message. The plugin is being disabled, but later, coverage doesn't take that into account, and tries to do some final bookkeeping for a plugin which never recorded any lines. You can fix the problem by enabling debugging in your template engine:
I'll have to think about how to fix coverage so that it properly tracks disabled plugins. I've written it up as nedbat/coveragepy#1011. |
A combination of
django
,pytest
,pytest-cov
,django-coverage-plugin
andpytest-django
seems to interact with each other causingCoverageException
when tests execute code that renders templates. My guess is it's somewhere indjango-coverage-plugin
as disabling it, removes the exception.I created an example Django project that exhibits this issue: https://github.com/suda/pytest_django_coverage_test
Not sure if it's a bug or misconfiguration but I hope this repo will be useful for figuring out the root cause 😊
The text was updated successfully, but these errors were encountered: