-
Notifications
You must be signed in to change notification settings - Fork 214
_pytest.assertion.reinterpret.AssertionError: Test coverage should never be None
#84
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
Comments
Interesting. What's your command line and pytest options (specifically |
PS. |
It's looking like this might be an interaction between pytest-cov 2.0 and teamcity-messages, because it fails when the Hmmm... I'll post more as I find out more... |
Hmmm, upgrading from teamcity-messages 1.9.4 to 1.14 seems to fix the problem. Hope this helps someone. |
Well. I'm still getting this message on Travis CI with Full messages were like: (...)
[gw1] PASSED tests/web/util_test.py::test_slc
[gw0] PASSED tests/web/util_test.py::test_slc_entry INTERNALERROR> Traceback (most recent call last):
INTERNALERROR> File "/home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages/_pytest/main.py", line 94, in wrap_session
INTERNALERROR> session.exitstatus = doit(config, session) or 0
INTERNALERROR> File "/home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages/_pytest/main.py", line 125, in _main
INTERNALERROR> config.hook.pytest_runtestloop(session=session)
INTERNALERROR> File "/home/travis/virtualenv/python2.7.9/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/travis/virtualenv/python2.7.9/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/travis/virtualenv/python2.7.9/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/travis/virtualenv/python2.7.9/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/travis/virtualenv/python2.7.9/lib/python2.7/site-packages/_pytest/vendored_packages/pluggy.py", line 249, in _wrapped_call
INTERNALERROR> wrap_controller.send(call_outcome)
INTERNALERROR> File "/home/travis/virtualenv/python2.7.9/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`
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR> File "/home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages/_pytest/main.py", line 94, in wrap_session
INTERNALERROR> session.exitstatus = doit(config, session) or 0
INTERNALERROR> File "/home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages/_pytest/main.py", line 125, in _main
INTERNALERROR> config.hook.pytest_runtestloop(session=session)
INTERNALERROR> File "/home/travis/virtualenv/python2.7.9/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/travis/virtualenv/python2.7.9/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/travis/virtualenv/python2.7.9/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/travis/virtualenv/python2.7.9/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/travis/virtualenv/python2.7.9/lib/python2.7/site-packages/_pytest/vendored_packages/pluggy.py", line 249, in _wrapped_call
INTERNALERROR> wrap_controller.send(call_outcome)
INTERNALERROR> File "/home/travis/virtualenv/python2.7.9/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: platform linux2, python 2.7.9-final-0 -----------
Coverage XML written to file coverage.xml
=================== 1062 passed, 1 skipped in 313.52 seconds ===================
The command "py.test -n2 --durations=20 --database-url 'postgresql:///travis_ci_test?user=postgres' --cov-config .coveragerc --cov-report=xml --cov=beat -vv -x --rerun 5 tests/" exited with 0. |
@yoloseem what's your |
@ionelmc Didn't pinned explicitly but |
It only happens to me when I specify
|
@ionelmc that's correct. I upgraded to 2.3.1 and I can't recreate it. Thx. |
With pytest-cov 2.0, I'm getting:
On the same projects with pytest-cov 1.8.1, it works fine.
Example command-line:
As you can see it actually prints a coverage report to stdout, so I don't know why it thinks the test coverage is
None
.Here's what's installed:
The text was updated successfully, but these errors were encountered: