You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Like --tb=long/short, --tb=native should only show user frame frames.
Users of "native" want the same scope of information, just in the native traceback format. I believe it's straightforward to prune the traceback object before formatting.
currently:
___________________________________ test_foo ___________________________________
Traceback (most recent call last):
File "/.../lib/python3.11/site-packages/_pytest/runner.py", line 340, in from_call
result: Optional[TResult] = func()
^^^^^^
File "/.../lib/python3.11/site-packages/_pytest/runner.py", line 240, in <lambda>
lambda: runtest_hook(item=item, **kwds), when=when, reraise=reraise
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/.../lib/python3.11/site-packages/pluggy/_hooks.py", line 501, in __call__
return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/.../lib/python3.11/site-packages/pluggy/_manager.py", line 119, in _hookexec
return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/.../lib/python3.11/site-packages/pluggy/_callers.py", line 181, in _multicall
return outcome.get_result()
^^^^^^^^^^^^^^^^^^^^
File "/.../lib/python3.11/site-packages/pluggy/_result.py", line 99, in get_result
raise exc.with_traceback(exc.__traceback__)
File "/.../lib/python3.11/site-packages/pluggy/_callers.py", line 166, in _multicall
teardown.throw(outcome._exception)
File "/.../lib/python3.11/site-packages/_pytest/threadexception.py", line 87, in pytest_runtest_call
yield from thread_exception_runtest_hook()
File "/.../lib/python3.11/site-packages/_pytest/threadexception.py", line 63, in thread_exception_runtest_hook
yield
File "/.../lib/python3.11/site-packages/pluggy/_callers.py", line 166, in _multicall
teardown.throw(outcome._exception)
File "/.../lib/python3.11/site-packages/_pytest/unraisableexception.py", line 90, in pytest_runtest_call
yield from unraisable_exception_runtest_hook()
File "/.../lib/python3.11/site-packages/_pytest/unraisableexception.py", line 65, in unraisable_exception_runtest_hook
yield
File "/.../lib/python3.11/site-packages/pluggy/_callers.py", line 166, in _multicall
teardown.throw(outcome._exception)
File "/.../lib/python3.11/site-packages/_pytest/logging.py", line 849, in pytest_runtest_call
yield from self._runtest_for(item, "call")
File "/.../lib/python3.11/site-packages/_pytest/logging.py", line 832, in _runtest_for
yield
File "/.../lib/python3.11/site-packages/pluggy/_callers.py", line 166, in _multicall
teardown.throw(outcome._exception)
File "/.../lib/python3.11/site-packages/_pytest/capture.py", line 883, in pytest_runtest_call
return (yield)
^^^^^
File "/.../lib/python3.11/site-packages/pluggy/_callers.py", line 166, in _multicall
teardown.throw(outcome._exception)
File "/.../lib/python3.11/site-packages/_pytest/skipping.py", line 256, in pytest_runtest_call
return (yield)
^^^^^
File "/.../lib/python3.11/site-packages/pluggy/_callers.py", line 102, in _multicall
res = hook_impl.function(*args)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/.../lib/python3.11/site-packages/_pytest/runner.py", line 182, in pytest_runtest_call
raise e
File "/.../lib/python3.11/site-packages/_pytest/runner.py", line 172, in pytest_runtest_call
item.runtest()
File "/.../lib/python3.11/site-packages/_pytest/python.py", line 1772, in runtest
self.ihook.pytest_pyfunc_call(pyfuncitem=self)
File "/.../lib/python3.11/site-packages/pluggy/_hooks.py", line 501, in __call__
return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/.../lib/python3.11/site-packages/pluggy/_manager.py", line 119, in _hookexec
return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/.../lib/python3.11/site-packages/pluggy/_callers.py", line 138, in _multicall
raise exception.with_traceback(exception.__traceback__)
File "/.../lib/python3.11/site-packages/pluggy/_callers.py", line 102, in _multicall
res = hook_impl.function(*args)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/.../lib/python3.11/site-packages/_pytest/python.py", line 195, in pytest_pyfunc_call
result = testfunction(**testargs)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/.../pytest_tb_test.py", line 6, in test_foo
bar()
File "/home/.../pytest_tb_test.py", line 2, in bar
raise ValueError('oops')
ValueError: oops
wanted:
___________________________________ test_foo ___________________________________
Traceback (most recent call last):
File "/home/.../pytest_tb_test.py", line 6, in test_foo
bar()
File "/home/.../pytest_tb_test.py", line 2, in bar
raise ValueError('oops')
ValueError: oops
The text was updated successfully, but these errors were encountered:
The whole point of --tb=native is to turn off any traceback processing, which is very useful to get the actual traceback if there are any bugs in that processing (e.g. frames are being hidden that shouldn't be) — so I'm -1 to this, as it defeats the whole purpose.
What's your use-case here, and how does your desired output differ from what --tb=short already gives you?
Like --tb=long/short, --tb=native should only show user frame frames.
Users of "native" want the same scope of information, just in the native traceback format. I believe it's straightforward to prune the traceback object before formatting.
currently:
wanted:
The text was updated successfully, but these errors were encountered: