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

INTERNALERROR> AssertionError: Test coverage should never be `None` #124

Closed
kierun opened this Issue Jul 11, 2016 · 5 comments

Comments

Projects
None yet
5 participants
@kierun

kierun commented Jul 11, 2016

When running tests in parallel |(for -n of one or more), I get this weird internalerror message. However, if I run the tests without the -n 1 option, everything is fine.

; py.test --cov=wireless_id_label_editor -n 1 tests/
============================================================================== test session starts ==============================================================================
platform linux2 -- Python 2.7.5, pytest-2.9.2, py-1.4.31, pluggy-0.3.1
rootdir: /home/usr/repos/wireless_id_label_editor, inifile: setup.cfg
plugins: pylama-7.0.9, bdd-2.17.0, catchlog-1.2.2, colordots-0.1, cov-2.3.0, html-1.9.0, pep8-1.0.6, xdist-1.14
gw0 [123]
scheduling tests via LoadScheduling
...........................................................................................................................INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/home/usr/.virtualenvs/widle/lib/python2.7/site-packages/_pytest/main.py", line 94, in wrap_session
INTERNALERROR>     session.exitstatus = doit(config, session) or 0
INTERNALERROR>   File "/home/usr/.virtualenvs/widle/lib/python2.7/site-packages/_pytest/main.py", line 125, in _main
INTERNALERROR>     config.hook.pytest_runtestloop(session=session)
INTERNALERROR>   File "/home/usr/.virtualenvs/widle/lib/python2.7/site-packages/_pytest/vendored_packages/pluggy.py", line 724, in __call__
INTERNALERROR>     return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
INTERNALERROR>   File "/home/usr/.virtualenvs/widle/lib/python2.7/site-packages/_pytest/vendored_packages/pluggy.py", line 338, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "/home/usr/.virtualenvs/widle/lib/python2.7/site-packages/_pytest/vendored_packages/pluggy.py", line 333, in <lambda>
INTERNALERROR>     _MultiCall(methods, kwargs, hook.spec_opts).execute()
INTERNALERROR>   File "/home/usr/.virtualenvs/widle/lib/python2.7/site-packages/_pytest/vendored_packages/pluggy.py", line 595, in execute
INTERNALERROR>     return _wrapped_call(hook_impl.function(*args), self.execute)
INTERNALERROR>   File "/home/usr/.virtualenvs/widle/lib/python2.7/site-packages/_pytest/vendored_packages/pluggy.py", line 249, in _wrapped_call
INTERNALERROR>     wrap_controller.send(call_outcome)
INTERNALERROR>   File "/home/usr/.virtualenvs/widle/lib/python2.7/site-packages/pytest_cov/plugin.py", line 221, in pytest_runtestloop
INTERNALERROR>     assert self.cov_total is not None, 'Test coverage should never be `None`'
INTERNALERROR> AssertionError: Test coverage should never be `None`
Coverage.py warning: No data was collected.


---------- coverage: platform linux2, python 2.7.5-final-0 -----------
Name                                              Stmts   Miss Branch BrPart    Cover   Missing
-----------------------------------------------------------------------------------------------
wireless_id_label_editor/RFC2217_client.py           87      0     12      0   100.0%
wireless_id_label_editor/from_reader.py              84      0     22      0   100.0%
wireless_id_label_editor/function_dispatcher.py      22      0      4      0   100.0%
wireless_id_label_editor/gui.py                     276      0     58      0   100.0%
wireless_id_label_editor/nifty_logger.py             56      0      2      0   100.0%
wireless_id_label_editor/reader.py                   13      0      0      0   100.0%
wireless_id_label_editor/to_reader.py                53      0      0      0   100.0%
-----------------------------------------------------------------------------------------------
TOTAL                                               591      0     98      0   100.0%

@mozbhearsum

This comment has been minimized.

mozbhearsum commented Jul 11, 2016

@gst

This comment has been minimized.

gst commented Jul 15, 2016

fyi : I have the same assertion error also using with -n argument and without then the internalerror disappear

@foobarna

This comment has been minimized.

foobarna commented Jul 18, 2016

Same thing happens locally with pytest-cov==2.3.0.
I've "fixed" it by pinning in tox pytest-cov==2.2.1

INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/Users/blink/workspace/flowy/.tox/py35/lib/python3.5/site-packages/_pytest/main.py", line 94, in wrap_session
INTERNALERROR>     session.exitstatus = doit(config, session) or 0
INTERNALERROR>   File "/Users/blink/workspace/flowy/.tox/py35/lib/python3.5/site-packages/_pytest/main.py", line 125, in _main
INTERNALERROR>     config.hook.pytest_runtestloop(session=session)
INTERNALERROR>   File "/Users/blink/workspace/flowy/.tox/py35/lib/python3.5/site-packages/_pytest/vendored_packages/pluggy.py", line 724, in __call__
INTERNALERROR>     return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
INTERNALERROR>   File "/Users/blink/workspace/flowy/.tox/py35/lib/python3.5/site-packages/_pytest/vendored_packages/pluggy.py", line 338, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "/Users/blink/workspace/flowy/.tox/py35/lib/python3.5/site-packages/_pytest/vendored_packages/pluggy.py", line 333, in <lambda>
INTERNALERROR>     _MultiCall(methods, kwargs, hook.spec_opts).execute()
INTERNALERROR>   File "/Users/blink/workspace/flowy/.tox/py35/lib/python3.5/site-packages/_pytest/vendored_packages/pluggy.py", line 595, in execute
INTERNALERROR>     return _wrapped_call(hook_impl.function(*args), self.execute)
INTERNALERROR>   File "/Users/blink/workspace/flowy/.tox/py35/lib/python3.5/site-packages/_pytest/vendored_packages/pluggy.py", line 249, in _wrapped_call
INTERNALERROR>     wrap_controller.send(call_outcome)
INTERNALERROR>   File "/Users/blink/workspace/flowy/.tox/py35/lib/python3.5/site-packages/pytest_cov/plugin.py", line 221, in pytest_runtestloop
INTERNALERROR>     assert self.cov_total is not None, 'Test coverage should never be `None`'
INTERNALERROR> AssertionError: Test coverage should never be `None`
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/Users/blink/workspace/flowy/.tox/py35/lib/python3.5/site-packages/_pytest/main.py", line 94, in wrap_session
INTERNALERROR>     session.exitstatus = doit(config, session) or 0
INTERNALERROR>   File "/Users/blink/workspace/flowy/.tox/py35/lib/python3.5/site-packages/_pytest/main.py", line 125, in _main
INTERNALERROR>     config.hook.pytest_runtestloop(session=session)
INTERNALERROR>   File "/Users/blink/workspace/flowy/.tox/py35/lib/python3.5/site-packages/_pytest/vendored_packages/pluggy.py", line 724, in __call__
INTERNALERROR>     return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
INTERNALERROR>   File "/Users/blink/workspace/flowy/.tox/py35/lib/python3.5/site-packages/_pytest/vendored_packages/pluggy.py", line 338, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "/Users/blink/workspace/flowy/.tox/py35/lib/python3.5/site-packages/_pytest/vendored_packages/pluggy.py", line 333, in <lambda>
INTERNALERROR>     _MultiCall(methods, kwargs, hook.spec_opts).execute()
INTERNALERROR>   File "/Users/blink/workspace/flowy/.tox/py35/lib/python3.5/site-packages/_pytest/vendored_packages/pluggy.py", line 595, in execute
INTERNALERROR>     return _wrapped_call(hook_impl.function(*args), self.execute)
INTERNALERROR>   File "/Users/blink/workspace/flowy/.tox/py35/lib/python3.5/site-packages/_pytest/vendored_packages/pluggy.py", line 249, in _wrapped_call
INTERNALERROR>     wrap_controller.send(call_outcome)
INTERNALERROR>   File "/Users/blink/workspace/flowy/.tox/py35/lib/python3.5/site-packages/pytest_cov/plugin.py", line 221, in pytest_runtestloop
INTERNALERROR>     assert self.cov_total is not None, 'Test coverage should never be `None`'
INTERNALERROR> AssertionError: Test coverage should never be `None`
FINTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/Users/blink/workspace/flowy/.tox/py35/lib/python3.5/site-packages/_pytest/main.py", line 94, in wrap_session
INTERNALERROR>     session.exitstatus = doit(config, session) or 0
INTERNALERROR>   File "/Users/blink/workspace/flowy/.tox/py35/lib/python3.5/site-packages/_pytest/main.py", line 125, in _main
INTERNALERROR>     config.hook.pytest_runtestloop(session=session)
INTERNALERROR>   File "/Users/blink/workspace/flowy/.tox/py35/lib/python3.5/site-packages/_pytest/vendored_packages/pluggy.py", line 724, in __call__
INTERNALERROR>     return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
INTERNALERROR>   File "/Users/blink/workspace/flowy/.tox/py35/lib/python3.5/site-packages/_pytest/vendored_packages/pluggy.py", line 338, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "/Users/blink/workspace/flowy/.tox/py35/lib/python3.5/site-packages/_pytest/vendored_packages/pluggy.py", line 333, in <lambda>
INTERNALERROR>     _MultiCall(methods, kwargs, hook.spec_opts).execute()
INTERNALERROR>   File "/Users/blink/workspace/flowy/.tox/py35/lib/python3.5/site-packages/_pytest/vendored_packages/pluggy.py", line 595, in execute
INTERNALERROR>     return _wrapped_call(hook_impl.function(*args), self.execute)
INTERNALERROR>   File "/Users/blink/workspace/flowy/.tox/py35/lib/python3.5/site-packages/_pytest/vendored_packages/pluggy.py", line 249, in _wrapped_call
INTERNALERROR>     wrap_controller.send(call_outcome)
INTERNALERROR>   File "/Users/blink/workspace/flowy/.tox/py35/lib/python3.5/site-packages/pytest_cov/plugin.py", line 221, in pytest_runtestloop
INTERNALERROR>     assert self.cov_total is not None, 'Test coverage should never be `None`'
INTERNALERROR> AssertionError: Test coverage should never be `None`
.INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/Users/blink/workspace/flowy/.tox/py35/lib/python3.5/site-packages/_pytest/main.py", line 94, in wrap_session
INTERNALERROR>     session.exitstatus = doit(config, session) or 0
INTERNALERROR>   File "/Users/blink/workspace/flowy/.tox/py35/lib/python3.5/site-packages/_pytest/main.py", line 125, in _main
INTERNALERROR>     config.hook.pytest_runtestloop(session=session)
INTERNALERROR>   File "/Users/blink/workspace/flowy/.tox/py35/lib/python3.5/site-packages/_pytest/vendored_packages/pluggy.py", line 724, in __call__
INTERNALERROR>     return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
INTERNALERROR>   File "/Users/blink/workspace/flowy/.tox/py35/lib/python3.5/site-packages/_pytest/vendored_packages/pluggy.py", line 338, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "/Users/blink/workspace/flowy/.tox/py35/lib/python3.5/site-packages/_pytest/vendored_packages/pluggy.py", line 333, in <lambda>
INTERNALERROR>     _MultiCall(methods, kwargs, hook.spec_opts).execute()
INTERNALERROR>   File "/Users/blink/workspace/flowy/.tox/py35/lib/python3.5/site-packages/_pytest/vendored_packages/pluggy.py", line 595, in execute
INTERNALERROR>     return _wrapped_call(hook_impl.function(*args), self.execute)
INTERNALERROR>   File "/Users/blink/workspace/flowy/.tox/py35/lib/python3.5/site-packages/_pytest/vendored_packages/pluggy.py", line 249, in _wrapped_call
INTERNALERROR>     wrap_controller.send(call_outcome)
INTERNALERROR>   File "/Users/blink/workspace/flowy/.tox/py35/lib/python3.5/site-packages/pytest_cov/plugin.py", line 221, in pytest_runtestloop
INTERNALERROR>     assert self.cov_total is not None, 'Test coverage should never be `None`'
INTERNALERROR> AssertionError: Test coverage should never be `None`
Coverage.py warning: No data was collected.
@ionelmc

This comment has been minimized.

Member

ionelmc commented Aug 6, 2016

It would appear that pytest_runtestloop hook is being called in the dist slaves (which don't have any summary info). This is a regression caused by #116

Hmmm

@ionelmc

This comment has been minimized.

Member

ionelmc commented Aug 7, 2016

fyi, released 2.3.1 with fix

jsonn pushed a commit to jsonn/pkgsrc that referenced this issue Aug 22, 2016

wiz
Updated py-test-cov to 2.3.1.
2.3.1 (2016-08-07)
------------------

* Fixed regression causing spurious errors when xdist was used. See `#124
  <https://github.com/pytest-dev/pytest-cov/issues/124>`_.
* Fixed DeprecationWarning about incorrect `addoption` use. Contributed by Florian Bruhin in `PR#127
  <https://github.com/pytest-dev/pytest-cov/pull/127>`_.
* Fixed deprecated use of funcarg fixture API. Contributed by Daniel Hahler in `PR#125
  <https://github.com/pytest-dev/pytest-cov/pull/125>`_.

2.3.0 (2016-07-05)
------------------

* Add support for specifying output location for html, xml, and annotate report.
  Contributed by Patrick Lannigan in `PR#113 <https://github.com/pytest-dev/pytest-cov/pull/113>`_.
* Fix bug hiding test failure when cov-fail-under failed.
* For coverage >= 4.0, match the default behaviour of `coverage report` and
  error if coverage fails to find the source instead of just printing a warning.
  Contributed by David Szotten in `PR#116 <https://github.com/pytest-dev/pytest-cov/pull/116>`_.
* Fixed bug occurred when bare ``--cov`` parameter was used with xdist.
  Contributed by Michael Elovskikh in `PR#120 <https://github.com/pytest-dev/pytest-cov/pull/120>`_.
* Add support for ``skip_covered`` and added ``--cov-report=term-skip-covered`` command
  line options. Contributed by Saurabh Kumar in `PR#115 <https://github.com/pytest-dev/pytest-cov/pull/115>`_.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment