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
{{ message }}
Repository navigation
Bug: Traceback cleanup fails on Exception/pytest.fail in Item.runtest #7692
output of pip list from the virtual environment you are using
pytest and operating system versions
minimal example if possible
Not strictly minimal, but I'll see if I can minimize it sometime this week.
I have a small plugin that dynamically generates tests based on some custom boilerplate. These tests have the following form [0]:
# In Item subclassdefruntest(self):
assertself.function(*self.args, **self.kwargs)
One such test happens to fail, with the following traceback: [1]. pytest.fail also results in similar output. Clearly, something went wrong – even frames with __tracebackhide__ are getting shown.
Activity
asottile commentedon Aug 27, 2020
it's easily reproducible with the
nonpythonexample in the docs, but by removing the custom exception repr / failure messagingasottile commentedon Aug 27, 2020
this improves the output:
but I suspect that the expectation is if you implement an
Itemyou should also implementrepr_failureasottile commentedon Aug 27, 2020
(note that while it improves the output, it still contains many frames of pytest plugin calls)
gdhameeja commentedon Aug 31, 2020
I'd like to work on this.