OutcomeExceptions should be handled during collection (not causing INTERNALERROR)
See original GitHub issueWhen trying to use this from pytest-cov’s source:
% p -m 'not slow'
===================================== test session starts ======================================
platform linux -- Python 3.8.0, pytest-5.3.0, py-1.8.0, pluggy-0.13.1
rootdir: …/Vcs/pytest-cov, inifile: setup.cfg, testpaths: tests
plugins: forked-1.1.3, xdist-1.30.0, cov-2.8.1
collected 124 items
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR> File "…/Vcs/pytest-cov/.venv/lib/python3.8/site-packages/_pytest/main.py", line 196, in wrap_session
INTERNALERROR> session.exitstatus = doit(config, session) or 0
INTERNALERROR> File "…/Vcs/pytest-cov/.venv/lib/python3.8/site-packages/_pytest/main.py", line 239, in _main
INTERNALERROR> config.hook.pytest_collection(session=session)
INTERNALERROR> File "…/Vcs/pytest-cov/.venv/lib/python3.8/site-packages/pluggy/hooks.py", line 286, in __call__
INTERNALERROR> return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR> File "…/Vcs/pytest-cov/.venv/lib/python3.8/site-packages/pluggy/manager.py", line 93, in _hookexec
INTERNALERROR> return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR> File "…/Vcs/pytest-cov/.venv/lib/python3.8/site-packages/pluggy/manager.py", line 84, in <lambda>
INTERNALERROR> self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall(
INTERNALERROR> File "…/Vcs/pytest-cov/.venv/lib/python3.8/site-packages/pluggy/callers.py", line 208, in _multicall
INTERNALERROR> return outcome.get_result()
INTERNALERROR> File "…/Vcs/pytest-cov/.venv/lib/python3.8/site-packages/pluggy/callers.py", line 80, in get_result
INTERNALERROR> raise ex[1].with_traceback(ex[2])
INTERNALERROR> File "…/Vcs/pytest-cov/.venv/lib/python3.8/site-packages/pluggy/callers.py", line 187, in _multicall
INTERNALERROR> res = hook_impl.function(*args)
INTERNALERROR> File "…/Vcs/pytest-cov/.venv/lib/python3.8/site-packages/_pytest/main.py", line 249, in pytest_collection
INTERNALERROR> return session.perform_collect()
INTERNALERROR> File "…/Vcs/pytest-cov/.venv/lib/python3.8/site-packages/_pytest/main.py", line 450, in perform_collect
INTERNALERROR> hook.pytest_collection_modifyitems(
INTERNALERROR> File "…/Vcs/pytest-cov/.venv/lib/python3.8/site-packages/pluggy/hooks.py", line 286, in __call__
INTERNALERROR> return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR> File "…/Vcs/pytest-cov/.venv/lib/python3.8/site-packages/pluggy/manager.py", line 93, in _hookexec
INTERNALERROR> return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR> File "…/Vcs/pytest-cov/.venv/lib/python3.8/site-packages/pluggy/manager.py", line 84, in <lambda>
INTERNALERROR> self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall(
INTERNALERROR> File "…/Vcs/pytest-cov/.venv/lib/python3.8/site-packages/pluggy/callers.py", line 208, in _multicall
INTERNALERROR> return outcome.get_result()
INTERNALERROR> File "…/Vcs/pytest-cov/.venv/lib/python3.8/site-packages/pluggy/callers.py", line 80, in get_result
INTERNALERROR> raise ex[1].with_traceback(ex[2])
INTERNALERROR> File "…/Vcs/pytest-cov/.venv/lib/python3.8/site-packages/pluggy/callers.py", line 182, in _multicall
INTERNALERROR> next(gen) # first yield
INTERNALERROR> File "…/Vcs/pytest-cov/tests/conftest.py", line 34, in pytest_collection_modifyitems
INTERNALERROR> item.add_marker(pytest.mark.slow)
INTERNALERROR> File "…/Vcs/pytest-cov/.venv/lib/python3.8/site-packages/_pytest/mark/structures.py", line 313, in __getattr__
INTERNALERROR> fail(
INTERNALERROR> File "…/Vcs/pytest-cov/.venv/lib/python3.8/site-packages/_pytest/outcomes.py", line 128, in fail
INTERNALERROR> raise Failed(msg=msg, pytrace=pytrace)
INTERNALERROR> Failed: 'slow' not found in `markers` configuration option
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (9 by maintainers)
Top Results From Across the Web
Changelog — pytest documentation
Backward incompatible (breaking) changes will only be introduced in major versions with advance notice in the Deprecations section of releases.
Read more >VisiBroker 8.5.2 VisiTransact Guide - Micro Focus
Introducing Current as used in VisiTransact-managed transactions . ... During installation on UNIX systems, the default is to not include an ...
Read more >vue.js - too much recursion: failed to use axios - Stack Overflow
Here you have 2 options: If you're using Vue3, import it in your Vue, like you did, but as written in this awnser,...
Read more >mozilla-central: changeset 568432 ...
Created async versions of start and end for the class to handle ... introduced in 4.6.0 causing collection errors when passing - more...
Read more >[py-svn] pytest commit 4e2a0da2c7df: flat is better than nested ...
+ if name not in dic: + if raising: + raise KeyError(name) + else: + ... return # recursive collect, XXX refactor capturing...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Ok. Just to be clear: it was me adding
item.add_marker(pytest.mark.slow)
to its conftest (locally), and this issue is about improving the UX / error in that case (for when it is not registered). IIRC this error is better in general, so is likely aboutfail.Exception
not being handled here properly.There’s no registered
slow
marker, butpytest-cov/tests/conftest.py
tries to add it anyway.It’s definitely a UX problem for
pytest
, but it’s reporting a real problem forpytest-cov
.