Skip to content

OutcomeExceptions should be handled during collection (not causing INTERNALERROR) #6263

@blueyed

Description

@blueyed

When 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugproblem that needs to be addressed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions