pytest-sugar: Breaks when py is not installed
pytest 7.2.0, released just now, makes py an optional dependency (https://docs.pytest.org/en/stable/changelog.html#pytest-7-2-0-2022-10-23), but pytest-sugar still relies on it, leading to a crash if py is not installed:
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR> File "/home/jelle/ans/venv3.9/lib/python3.9/site-packages/_pytest/main.py", line 268, in wrap_session
INTERNALERROR> config.hook.pytest_sessionstart(session=session)
INTERNALERROR> File "/home/jelle/ans/venv3.9/lib/python3.9/site-packages/pluggy/hooks.py", line 286, in __call__
INTERNALERROR> return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR> File "/home/jelle/ans/venv3.9/lib/python3.9/site-packages/pluggy/manager.py", line 93, in _hookexec
INTERNALERROR> return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR> File "/home/jelle/ans/venv3.9/lib/python3.9/site-packages/pluggy/manager.py", line 84, in <lambda>
INTERNALERROR> self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall(
INTERNALERROR> File "/home/jelle/ans/venv3.9/lib/python3.9/site-packages/pluggy/callers.py", line 208, in _multicall
INTERNALERROR> return outcome.get_result()
INTERNALERROR> File "/home/jelle/ans/venv3.9/lib/python3.9/site-packages/pluggy/callers.py", line 80, in get_result
INTERNALERROR> raise ex[1].with_traceback(ex[2])
INTERNALERROR> File "/home/jelle/ans/venv3.9/lib/python3.9/site-packages/pluggy/callers.py", line 187, in _multicall
INTERNALERROR> res = hook_impl.function(*args)
INTERNALERROR> File "/home/jelle/ans/venv3.9/lib/python3.9/site-packages/pytest_sugar.py", line 242, in pytest_sessionstart
INTERNALERROR> self._sessionstarttime = py.std.time.time()
INTERNALERROR> AttributeError: module 'py' has no attribute 'std'
(Invoking pytest in a env with pytest-sugar but not py installed.)
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 14
- Comments: 15 (2 by maintainers)
Commits related to this issue
- Remove `py.std` calls Fixes #241 — committed to alexcjohnson/pytest-sugar by alexcjohnson 4 years ago
- Install py for pytest-sugar (#87803) linux-focal-py3.7-clang10-onnx / test is failng, the issue is https://github.com/Teemu/pytest-sugar/issues/241 Pull Request resolved: https://github.com/pytorch/... — committed to pytorch/pytorch by kit1980 4 years ago
- Add py to dev dependencies https://github.com/Teemu/pytest-sugar/issues/241 — committed to smkent/cookie-python by smkent 4 years ago
- build(pyproject): add py to dev to fix pytest-sugar see also https://github.com/Teemu/pytest-sugar/issues/241 — committed to rachmadaniHaryono/mitmproxy-image by rachmadaniHaryono 4 years ago
- Install py for pytest-sugar (#87803) linux-focal-py3.7-clang10-onnx / test is failng, the issue is https://github.com/Teemu/pytest-sugar/issues/241 Pull Request resolved: https://github.com/pytorch/... — committed to kulinseth/pytorch by kit1980 4 years ago
- Remove py dependency https://github.com/Teemu/pytest-sugar/issues/241 is now resolved — committed to smkent/cookie-python by smkent 4 years ago
- Install py for pytest-sugar (#87803) linux-focal-py3.7-clang10-onnx / test is failng, the issue is https://github.com/Teemu/pytest-sugar/issues/241 Pull Request resolved: https://github.com/pytorch/... — committed to kulinseth/pytorch by kit1980 4 years ago
- Update pytest-sugar to fix pytest failures after upgrade with clean venv: https://github.com/Teemu/pytest-sugar/issues/241 — committed to UW-GAC/django-anvil-consortium-manager by jmcarson 4 years ago
- build(sugar): this package needed to be updated to avoid a bug we started seeing while running tests See https://github.com/Teemu/pytest-sugar/issues/241 for more info — committed to esnet-security/SCRAM by samoehlert 2 years ago
Released 0.9.6
@thewchan: As the maintainer and person who merged the fix, @Teemu is presumably well-aware that folks can’t take advantage of said fix until it has been published to PyPI. So let’s not pester @Teemu and instead wait patiently for the package to be published.
@ygworldr with the fix merged, can we expect a release on PyPI soon?
This looks good to me. My apologies for the earlier confusion!