Skip to content

Regression in pytest 4.4: INTERNALERROR with -p no:terminal --collect-only and crash #5505

@asottile

Description

@asottile
raise TypeError('oops!')

def test(): pass
$ pytest --version
This is pytest version 4.3.1, imported from /tmp/x/venv/lib/python3.6/site-packages/pytest.py
$ pytest -p no:terminal --collect-only t.py
$ echo $?
2
$ pytest --version
This is pytest version 4.6.3, imported from /tmp/x/venv/lib/python3.6/site-packages/pytest.py
$ pytest -p no:terminal --collect-only t.py
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/tmp/x/venv/lib/python3.6/site-packages/_pytest/config/__init__.py", line 1002, in getoption
INTERNALERROR>     val = getattr(self.option, name)
INTERNALERROR> AttributeError: 'Namespace' object has no attribute 'tbstyle'
INTERNALERROR> 
INTERNALERROR> During handling of the above exception, another exception occurred:
INTERNALERROR> 
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/tmp/x/venv/lib/python3.6/site-packages/_pytest/main.py", line 206, in wrap_session
INTERNALERROR>     session.exitstatus = doit(config, session) or 0
INTERNALERROR>   File "/tmp/x/venv/lib/python3.6/site-packages/_pytest/main.py", line 249, in _main
INTERNALERROR>     config.hook.pytest_collection(session=session)
INTERNALERROR>   File "/tmp/x/venv/lib/python3.6/site-packages/pluggy/hooks.py", line 289, in __call__
INTERNALERROR>     return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR>   File "/tmp/x/venv/lib/python3.6/site-packages/pluggy/manager.py", line 87, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "/tmp/x/venv/lib/python3.6/site-packages/pluggy/manager.py", line 81, in <lambda>
INTERNALERROR>     firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
INTERNALERROR>   File "/tmp/x/venv/lib/python3.6/site-packages/pluggy/callers.py", line 208, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/tmp/x/venv/lib/python3.6/site-packages/pluggy/callers.py", line 80, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/tmp/x/venv/lib/python3.6/site-packages/pluggy/callers.py", line 187, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/tmp/x/venv/lib/python3.6/site-packages/_pytest/main.py", line 259, in pytest_collection
INTERNALERROR>     return session.perform_collect()
INTERNALERROR>   File "/tmp/x/venv/lib/python3.6/site-packages/_pytest/main.py", line 495, in perform_collect
INTERNALERROR>     items = self._perform_collect(args, genitems)
INTERNALERROR>   File "/tmp/x/venv/lib/python3.6/site-packages/_pytest/main.py", line 534, in _perform_collect
INTERNALERROR>     self.items.extend(self.genitems(node))
INTERNALERROR>   File "/tmp/x/venv/lib/python3.6/site-packages/_pytest/main.py", line 769, in genitems
INTERNALERROR>     rep = collect_one_node(node)
INTERNALERROR>   File "/tmp/x/venv/lib/python3.6/site-packages/_pytest/runner.py", line 371, in collect_one_node
INTERNALERROR>     rep = ihook.pytest_make_collect_report(collector=collector)
INTERNALERROR>   File "/tmp/x/venv/lib/python3.6/site-packages/pluggy/hooks.py", line 289, in __call__
INTERNALERROR>     return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR>   File "/tmp/x/venv/lib/python3.6/site-packages/pluggy/manager.py", line 87, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "/tmp/x/venv/lib/python3.6/site-packages/pluggy/manager.py", line 81, in <lambda>
INTERNALERROR>     firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
INTERNALERROR>   File "/tmp/x/venv/lib/python3.6/site-packages/pluggy/callers.py", line 203, in _multicall
INTERNALERROR>     gen.send(outcome)
INTERNALERROR>   File "/tmp/x/venv/lib/python3.6/site-packages/_pytest/capture.py", line 213, in pytest_make_collect_report
INTERNALERROR>     rep = outcome.get_result()
INTERNALERROR>   File "/tmp/x/venv/lib/python3.6/site-packages/pluggy/callers.py", line 80, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/tmp/x/venv/lib/python3.6/site-packages/pluggy/callers.py", line 187, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/tmp/x/venv/lib/python3.6/site-packages/_pytest/runner.py", line 267, in pytest_make_collect_report
INTERNALERROR>     errorinfo = collector.repr_failure(call.excinfo)
INTERNALERROR>   File "/tmp/x/venv/lib/python3.6/site-packages/_pytest/nodes.py", line 332, in repr_failure
INTERNALERROR>     tbstyle = self.config.getoption("tbstyle")
INTERNALERROR>   File "/tmp/x/venv/lib/python3.6/site-packages/_pytest/config/__init__.py", line 1013, in getoption
INTERNALERROR>     raise ValueError("no option named %r" % (name,))
INTERNALERROR> ValueError: no option named 'tbstyle'

workaround

the last known good version is 4.3.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugproblem that needs to be addressed

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions