Skip to content
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

"Can't add file tracer data for unmeasured file" when a plugin is disabled. #1011

Closed
nedbat opened this issue Jul 12, 2020 · 2 comments
Closed
Labels
bug Something isn't working fixed plugin
Milestone

Comments

@nedbat
Copy link
Owner

nedbat commented Jul 12, 2020

(Originally reported with a reproducible case here: nedbat/django_coverage_plugin#69)

If a plugin is disabled, the collector will still try to record its association with the files, which will fail:

INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/usr/local/virtualenvs/tmp-91b59576424c64de/lib/python3.7/site-packages/_pytest/main.py", line 191, in wrap_session
INTERNALERROR>     session.exitstatus = doit(config, session) or 0
INTERNALERROR>   File "/usr/local/virtualenvs/tmp-91b59576424c64de/lib/python3.7/site-packages/_pytest/main.py", line 247, in _main
INTERNALERROR>     config.hook.pytest_runtestloop(session=session)
INTERNALERROR>   File "/usr/local/virtualenvs/tmp-91b59576424c64de/lib/python3.7/site-packages/pluggy/hooks.py", line 286, in __call__
INTERNALERROR>     return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR>   File "/usr/local/virtualenvs/tmp-91b59576424c64de/lib/python3.7/site-packages/pluggy/manager.py", line 93, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "/usr/local/virtualenvs/tmp-91b59576424c64de/lib/python3.7/site-packages/pluggy/manager.py", line 87, in <lambda>
INTERNALERROR>     firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
INTERNALERROR>   File "/usr/local/virtualenvs/tmp-91b59576424c64de/lib/python3.7/site-packages/pluggy/callers.py", line 203, in _multicall
INTERNALERROR>     gen.send(outcome)
INTERNALERROR>   File "/usr/local/virtualenvs/tmp-91b59576424c64de/lib/python3.7/site-packages/pytest_cov/plugin.py", line 254, in pytest_runtestloop
INTERNALERROR>     self.cov_controller.finish()
INTERNALERROR>   File "/usr/local/virtualenvs/tmp-91b59576424c64de/lib/python3.7/site-packages/pytest_cov/engine.py", line 197, in finish
INTERNALERROR>     self.cov.stop()
INTERNALERROR>   File "/usr/local/virtualenvs/tmp-91b59576424c64de/lib/python3.7/site-packages/coverage/control.py", line 649, in save
INTERNALERROR>     data = self.get_data()
INTERNALERROR>   File "/usr/local/virtualenvs/tmp-91b59576424c64de/lib/python3.7/site-packages/coverage/control.py", line 703, in get_data
INTERNALERROR>     if self._collector and self._collector.flush_data():
INTERNALERROR>   File "/usr/local/virtualenvs/tmp-91b59576424c64de/lib/python3.7/site-packages/coverage/collector.py", line 426, in flush_data
INTERNALERROR>     self.covdata.add_file_tracers(self.mapped_file_dict(self.file_tracers))
INTERNALERROR>   File "/usr/local/virtualenvs/tmp-91b59576424c64de/lib/python3.7/site-packages/coverage/sqldata.py", line 516, in add_file_tracers
INTERNALERROR>     "Can't add file tracer data for unmeasured file '%s'" % (filename,)
INTERNALERROR> coverage.misc.CoverageException: Can't add file tracer data for unmeasured file '/private/tmp/pytest_django_coverage_test/render_something/templates/render_something/index.html'
@nedbat
Copy link
Owner Author

nedbat commented Sep 13, 2020

Fixed in 039ef09

@nedbat nedbat closed this as completed Sep 13, 2020
@nedbat nedbat added the fixed label Sep 13, 2020
@nedbat
Copy link
Owner Author

nedbat commented Sep 13, 2020

This is now released as part of coverage 5.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed plugin
Projects
None yet
Development

No branches or pull requests

1 participant