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 run coverage with pytest 3.10.0 #235

Closed
albertodonato opened this issue Nov 6, 2018 · 4 comments
Closed

Can't run coverage with pytest 3.10.0 #235

albertodonato opened this issue Nov 6, 2018 · 4 comments

Comments

@albertodonato
Copy link

After upgrading to pytest 3.10.0, pytest --cov now fails with the following error:

INTERNALERROR>   File "/home/ack/prj/.ve/lib/python3.6/site-packages/_pytest/main.py", line 185, in wrap_session
INTERNALERROR>     session.exitstatus = doit(config, session) or 0
INTERNALERROR>   File "/home/ack/prj/.ve/lib/python3.6/site-packages/_pytest/main.py", line 225, in _main
INTERNALERROR>     config.hook.pytest_runtestloop(session=session)
INTERNALERROR>   File "/home/ack/prj/.ve/lib/python3.6/site-packages/pluggy/hooks.py", line 284, in __call__
INTERNALERROR>     return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR>   File "/home/ack/prj/.ve/lib/python3.6/site-packages/pluggy/manager.py", line 67, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "/home/ack/prj/.ve/lib/python3.6/site-packages/pluggy/manager.py", line 61, in <lambda>
INTERNALERROR>     firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
INTERNALERROR>   File "/home/ack/prj/.ve/lib/python3.6/site-packages/pluggy/callers.py", line 203, in _multicall
INTERNALERROR>     gen.send(outcome)
INTERNALERROR>   File "/home/ack/prj/.ve/lib/python3.6/site-packages/pluggy/callers.py", line 80, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/home/ack/prj/.ve/lib/python3.6/site-packages/pluggy/callers.py", line 187, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/home/ack/prj/.ve/lib/python3.6/site-packages/_pytest/main.py", line 246, in pytest_runtestloop
INTERNALERROR>     item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem)
INTERNALERROR>   File "/home/ack/prj/.ve/lib/python3.6/site-packages/pluggy/hooks.py", line 284, in __call__
INTERNALERROR>     return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR>   File "/home/ack/prj/.ve/lib/python3.6/site-packages/pluggy/manager.py", line 67, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "/home/ack/prj/.ve/lib/python3.6/site-packages/pluggy/manager.py", line 61, in <lambda>
INTERNALERROR>     firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
INTERNALERROR>   File "/home/ack/prj/.ve/lib/python3.6/site-packages/pluggy/callers.py", line 208, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/home/ack/prj/.ve/lib/python3.6/site-packages/pluggy/callers.py", line 80, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/home/ack/prj/.ve/lib/python3.6/site-packages/pluggy/callers.py", line 187, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/home/ack/prj/.ve/lib/python3.6/site-packages/_pytest/runner.py", line 78, in pytest_runtest_protocol
INTERNALERROR>     item.ihook.pytest_runtest_logfinish(nodeid=item.nodeid, location=item.location)
INTERNALERROR>   File "/home/ack/prj/.ve/lib/python3.6/site-packages/pluggy/hooks.py", line 284, in __call__
INTERNALERROR>     return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR>   File "/home/ack/prj/.ve/lib/python3.6/site-packages/pluggy/manager.py", line 67, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "/home/ack/prj/.ve/lib/python3.6/site-packages/pluggy/manager.py", line 61, in <lambda>
INTERNALERROR>     firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
INTERNALERROR>   File "/home/ack/prj/.ve/lib/python3.6/site-packages/pluggy/callers.py", line 208, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/home/ack/prj/.ve/lib/python3.6/site-packages/pluggy/callers.py", line 80, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/home/ack/prj/.ve/lib/python3.6/site-packages/pluggy/callers.py", line 187, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/home/ack/prj/.ve/lib/python3.6/site-packages/_pytest/terminal.py", line 432, in pytest_runtest_logfinish
INTERNALERROR>     len(self._progress_nodeids_reported) == self._session.testscollected
INTERNALERROR> AttributeError: 'NoneType' object has no attribute 'testscollected'

It worked fine with pytest 3.9.3.

@blueyed
Copy link
Contributor

blueyed commented Nov 6, 2018

Does it only happen with pytest-cov?
Which other plugins are you using? pytest-sugar maybe? Would be Teemu/pytest-sugar#159 then.

@albertodonato
Copy link
Author

@blueyed you're right, if I remove pytest-sugar, coverage works. I was tricked by the fact that running plain pytest without --cov worked even with pytest-sugar

@blueyed
Copy link
Contributor

blueyed commented Nov 6, 2018

Interesting, thanks for the update.

@blueyed blueyed closed this as completed Nov 6, 2018
@blueyed blueyed reopened this Nov 6, 2018
@blueyed
Copy link
Contributor

blueyed commented Nov 6, 2018

Hmm, according to Teemu/pytest-sugar#159 (comment) pytest-cov is not needed to trigger this.
Anyway, closing it here even though it is unclear what exactly triggers it.

@blueyed blueyed closed this as completed Nov 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants