Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tracebackhide is too aggressive when debugging fixture crashes #107

Open
oremanj opened this issue Sep 2, 2020 · 0 comments
Open

tracebackhide is too aggressive when debugging fixture crashes #107

oremanj opened this issue Sep 2, 2020 · 0 comments

Comments

@oremanj
Copy link
Member

oremanj commented Sep 2, 2020

I use pdbpp, which understands __tracebackhide__ like pytest does. Today, pytest --pdb on a simultaneous fixture+test crash dumped me at

[10] > [...]/lib/python3.8/site-packages/_pytest/python.py(166)pytest_pyfunc_call()
-> result = testfunction(**testargs)
   9 frames hidden (try 'help hidden_frames')

with no hint as to where I could find the constituent exceptions of the MultiError. It turns out that all the frames it passed through after being raised were hidden:

 [17]   [...]/lib/python3.8/site-packages/trio/testing/_trio_test.py(29)wrapper()
-> return _core.run(
[18]   [...]/lib/python3.8/site-packages/trio/_core/_run.py(1804)run()
-> raise runner.main_task_outcome.error
[19]   [...]/lib/python3.8/site-packages/pytest_trio/plugin.py(343)_bootstrap_fixtures_and_run_test()
-> raise trio.MultiError(test_ctx.error_list)

It seems like maybe we should remove the __tracebackhide__ from _bootstrap_fixtures_and_run_test? If the traceback starts somewhere within the test, it's pretty obvious that this thing called _bootstrap_fixtures_and_run_test is a boundary above which you're not going to find your own code. If it starts in the raise MultiError line in that function, having the frame not hidden is pretty useful in understanding what happened.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant