pytest-sugar: AttributeError: 'NoneType' object has no attribute 'testscollected'
Running some tests on circleci and I get the following exception (see full stacktrace below).
When I don’t install pytest-sugar, test runs fine.
Oddly enough I cannot (yet) reproduce locally.
Command used to run py.test
py.test
Output
INTERNALERROR> File "/home/circleci/circleci/venv/lib/python3.7/site-packages/_pytest/main.py", line 185, in wrap_session
INTERNALERROR> session.exitstatus = doit(config, session) or 0
INTERNALERROR> File "/home/circleci/circleci/venv/lib/python3.7/site-packages/_pytest/main.py", line 225, in _main
INTERNALERROR> config.hook.pytest_runtestloop(session=session)
INTERNALERROR> File "/home/circleci/circleci/venv/lib/python3.7/site-packages/pluggy/hooks.py", line 284, in __call__
INTERNALERROR> return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR> File "/home/circleci/circleci/venv/lib/python3.7/site-packages/pluggy/manager.py", line 67, in _hookexec
INTERNALERROR> return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR> File "/home/circleci/circleci/venv/lib/python3.7/site-packages/pluggy/manager.py", line 61, in <lambda>
INTERNALERROR> firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
INTERNALERROR> File "/home/circleci/circleci/venv/lib/python3.7/site-packages/pluggy/callers.py", line 203, in _multicall
INTERNALERROR> gen.send(outcome)
INTERNALERROR> File "/home/circleci/circleci/venv/lib/python3.7/site-packages/pluggy/callers.py", line 80, in get_result
INTERNALERROR> raise ex[1].with_traceback(ex[2])
INTERNALERROR> File "/home/circleci/circleci/venv/lib/python3.7/site-packages/pluggy/callers.py", line 187, in _multicall
INTERNALERROR> res = hook_impl.function(*args)
INTERNALERROR> File "/home/circleci/circleci/venv/lib/python3.7/site-packages/_pytest/main.py", line 246, in pytest_runtestloop
INTERNALERROR> item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem)
INTERNALERROR> File "/home/circleci/circleci/venv/lib/python3.7/site-packages/pluggy/hooks.py", line 284, in __call__
INTERNALERROR> return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR> File "/home/circleci/circleci/venv/lib/python3.7/site-packages/pluggy/manager.py", line 67, in _hookexec
INTERNALERROR> return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR> File "/home/circleci/circleci/venv/lib/python3.7/site-packages/pluggy/manager.py", line 61, in <lambda>
INTERNALERROR> firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
INTERNALERROR> File "/home/circleci/circleci/venv/lib/python3.7/site-packages/pluggy/callers.py", line 208, in _multicall
INTERNALERROR> return outcome.get_result()
INTERNALERROR> File "/home/circleci/circleci/venv/lib/python3.7/site-packages/pluggy/callers.py", line 80, in get_result
INTERNALERROR> raise ex[1].with_traceback(ex[2])
INTERNALERROR> File "/home/circleci/circleci/venv/lib/python3.7/site-packages/pluggy/callers.py", line 187, in _multicall
INTERNALERROR> res = hook_impl.function(*args)
INTERNALERROR> File "/home/circleci/circleci/venv/lib/python3.7/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/circleci/circleci/venv/lib/python3.7/site-packages/pluggy/hooks.py", line 284, in __call__
INTERNALERROR> return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR> File "/home/circleci/circleci/venv/lib/python3.7/site-packages/pluggy/manager.py", line 67, in _hookexec
INTERNALERROR> return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR> File "/home/circleci/circleci/venv/lib/python3.7/site-packages/pluggy/manager.py", line 61, in <lambda>
INTERNALERROR> firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
INTERNALERROR> File "/home/circleci/circleci/venv/lib/python3.7/site-packages/pluggy/callers.py", line 208, in _multicall
INTERNALERROR> return outcome.get_result()
INTERNALERROR> File "/home/circleci/circleci/venv/lib/python3.7/site-packages/pluggy/callers.py", line 80, in get_result
INTERNALERROR> raise ex[1].with_traceback(ex[2])
INTERNALERROR> File "/home/circleci/circleci/venv/lib/python3.7/site-packages/pluggy/callers.py", line 187, in _multicall
INTERNALERROR> res = hook_impl.function(*args)
INTERNALERROR> File "/home/circleci/circleci/venv/lib/python3.7/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'
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 3
- Comments: 17 (6 by maintainers)
Commits related to this issue
- Fix support for pytest >= 3.10 Regards Frozenball/pytest-sugar#133 Fixes Frozenball/pytest-sugar#159 — committed to michael-k/pytest-sugar by michael-k 8 years ago
- Fix version comparison handling. Fixes #159 — committed to Natim/pytest-sugar by deleted user 8 years ago
- Fix support for pytest >= 3.10 Regards Frozenball/pytest-sugar#133 Fixes Frozenball/pytest-sugar#159 — committed to Natim/pytest-sugar by michael-k 8 years ago
- Fix version comparison handling. Fixes #159 — committed to Natim/pytest-sugar by deleted user 8 years ago
- Workaround for Frozenball/pytest-sugar#159. — committed to jaraco/pip-run by jaraco 8 years ago
- Fix support for pytest >= 3.10 (#160) Regards Frozenball/pytest-sugar#133 Fixes Frozenball/pytest-sugar#159 — committed to Teemu/pytest-sugar by Natim 8 years ago
- Add workaround for Frozenball/pytest-sugar#159. — committed to jaraco/skeleton by jaraco 8 years ago
- Remove pytest-sugar plugin from standard pipelines as recommended in Frozenball/pytest-sugar#159. — committed to jaraco/skeleton by jaraco 8 years ago
- [update to 2.0] We're getting close, but Python 3.7 still requires a workaround Jason R. Coombs (38): Add appveyor badge (commented). Disable RTD by default. Limit workaround to affected ... — committed to clearlinux-pkgs/jaraco.functools by fenrus75 8 years ago
- portend: Autospec creation for update from version 2.3 to version 2.4 Jason R. Coombs (36): Don't match issues if preceeded by some other indicator. skip_upload_docs is default Drop... — committed to clearlinux-pkgs/portend by phmccarty 8 years ago
- [update to 1.14.1] Fix error in parse_timedelta doctest when run in the year running up to a leap day. Fixes #7. Jason R. Coombs (20): Update readme to reference UTC module. Add workaroun... — committed to clearlinux-pkgs/tempora by fenrus75 8 years ago
- [update to 19.0.1] Assign to _, which saves a reference to the object but doesn't violate linter's sensibilities. Andrew Dibble (1): add more specific error messages from _OS_X_API and re-raise... — committed to clearlinux-pkgs/keyring by fenrus75 8 years ago
- [update to 5.1] Duplicately supply a minimal metadata in setup.py to support setuptools older than 30.4. Fixes #49. Jason R. Coombs (57): Bump minimum pytest version Add pyproject.toml de... — committed to clearlinux-pkgs/pytest-runner by fenrus75 7 years ago
- jsonpickle: Autospec creation for update from version 1.3 to version 1.4.1 David Aguilar (56): tests: add tests for pandas Series with multi indexes pandas: improve serialization for Seri... — committed to clearlinux-pkgs/jsonpickle by phmccarty 7 years ago
- hgtools: Autospec creation for update from version 8.1.1 to version 8.2.0 Hugo (1): Fix AppVeyor typo Hugo van Kemenade (2): Spelling and capitalisation (#8) Link badge to PyPI rat... — committed to clearlinux-pkgs/hgtools by phmccarty 7 years ago
- Add workaround for Frozenball/pytest-sugar#159. — committed to jaraco/jaraco.vcs by jaraco 8 years ago
- Remove pytest-sugar plugin from standard pipelines as recommended in Frozenball/pytest-sugar#159. — committed to jaraco/jaraco.vcs by jaraco 8 years ago
Also, huge thanks to @blueyed for merging lots of PR and overall maintenance of this project. 🎉😇
thanks for the fix and the speed of the PR, when can expect a new release of pytest-sugar? 😃
I feel so horrible that I noticed this so late. I only got a notification to my email when I got an highlight from @blueyed 4 hours ago.
Anyway, 0.9.2. has been released. Hopefully nothing breaks since I did this in a hurry.
I’m seeing this as well:
Python and dependencies:
test_stuff.py:
tox.ini
But if I disable or remove pytest-sugar, this doesn’t happen.
FWIW, If I use
pytest==3.9.3, pytest-sugar works.Any rationale of why this is not a
pytest-sugar 0.9.2?This doesn’t just happen on Circle. Looks like
pytest 3.10.0isn’t supported atm.@Natim Did you also install pytest-sugar? I should have said you need the bugfix package in addition to pytest-sugar. The bugfix is just the patch.
I tried this technique, but unfortunately, it’s not always easy to put the override in the right place. There are projects where the pytest-sugar requirement is already pinned somewhere (by pip-compile) and updating it to use another download technique proved difficult and error-prone, whereas simply adding an additional requirement to the tox environment was sufficient to both work around the issue in a variety of environments but also in the same line document the meaning of it.
@Natim Because 0.9.2 would be next? 😉 Please stay calm, only @Frozenball can cut a release.
Since pytest 3.10 has other severe bugs it is good to wait for 3.10.1 there also anyway, btw. Apart from that I do not recommend to use pytest-sugar for CI/prod for reasons like this anyway.
I agree that a separate pytest-sugar-bugfix159 package makes no sense really, since it is easy to install master (or even a branch PR) instead.
I worked around the issue by adding this to conftest.py: