question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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%

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:4
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ionelmccommented, Aug 7, 2016

fyi, released 2.3.1 with fix

0reactions
ionelmccommented, 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 https://github.com/pytest-dev/pytest-cov/pull/116

Hmmm

Read more comments on GitHub >

github_iconTop Results From Across the Web

_pytest.assertion.reinterpret.AssertionError: Test coverage ...
AssertionError : Test coverage should never be `None` On the same projects with pytest-cov 1.8.1, it works fine. Example command-line: $ tox ...
Read more >
Python: AssertionError when running nose tests with coverage
In your module plugintest.py from nose-1.1.2-py2.7.egg/nose/plugins/ , line 174, one can read the following line : from multiprocessing import Manager.
Read more >
Usage and Invocations — pytest documentation
This will run tests which contain names that match the given string expression (case-insensitive), which can include Python operators that use filenames, class ......
Read more >
How To Use pytest For Python Testing - Software Testing Help
Learn what is pytest, how to install and use Python pytest with examples in this comprehensive tutorial.
Read more >
Testing Guide
Test Code Coverage ... AssertionError that is thrown whenever the assertion can not be validated successfully, contains an extended version ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found