Skip to content

INTERNALERROR with warning from pytest_configure #5115

@blueyed

Description

@blueyed
def test(testdir):
    testdir.makeconftest(
        """
        def pytest_configure():
            import warnings

            warnings.warn("from pytest_configure")
        """
    )

    result = testdir.runpytest()
    __import__('pdb').set_trace()
(Pdb++) pp result.ret
3
(Pdb++) pp result.stderr.lines
['INTERNALERROR> Traceback (most recent call last):',
 'INTERNALERROR>   File "…/Vcs/pytest/src/_pytest/main.py", line 205, in wrap_session',
 'INTERNALERROR>     config._do_configure()',
 'INTERNALERROR>   File "…/Vcs/pytest/src/_pytest/config/__init__.py", line 669, in _do_configure',
 'INTERNALERROR>     self.hook.pytest_configure.call_historic(kwargs=dict(config=self))',
 'INTERNALERROR>   File "…/Vcs/pytest/.venv/lib/python3.7/site-packages/pluggy/hooks.py", line 311, in call_historic',
 'INTERNALERROR>     res = self._hookexec(self, self.get_hookimpls(), kwargs)',
 'INTERNALERROR>   File "…/Vcs/pytest/.venv/lib/python3.7/site-packages/pluggy/manager.py", line 68, in _hookexec',
 'INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)',
 'INTERNALERROR>   File "…/Vcs/pytest/.venv/lib/python3.7/site-packages/pluggy/manager.py", line 62, in <lambda>',
 'INTERNALERROR>     firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,',
 'INTERNALERROR>   File "…/Vcs/pytest/.venv/lib/python3.7/site-packages/pluggy/callers.py", line 208, in _multicall',
 'INTERNALERROR>     return outcome.get_result()',
 'INTERNALERROR>   File "…/Vcs/pytest/.venv/lib/python3.7/site-packages/pluggy/callers.py", line 80, in get_result',
 'INTERNALERROR>     raise ex[1].with_traceback(ex[2])',
 'INTERNALERROR>   File "…/Vcs/pytest/.venv/lib/python3.7/site-packages/pluggy/callers.py", line 187, in _multicall',
 'INTERNALERROR>     res = hook_impl.function(*args)',
 'INTERNALERROR>   File "/tmp/pytest-of-user/pytest-919/test0/conftest.py", line 4, in pytest_configure',
 'INTERNALERROR>     warnings.warn("from pytest_configure")',
 'INTERNALERROR> UserWarning: from pytest_configure',
 '']
(Pdb++) pp result.stdout.lines
['']
```                                                                                                                                      ```
4.4.1.dev88+ga2a92e5c

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