Issue 22937: unittest errors can't show locals (original) (raw)
Issue22937
This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.
This issue has been migrated to GitHub: https://github.com/python/cpython/issues/67126
classification
Title: | unittest errors can't show locals | ||
---|---|---|---|
Type: | enhancement | Stage: | |
Components: | Library (Lib) | Versions: | Python 3.6 |
process
Status: | closed | Resolution: | fixed |
---|---|---|---|
Dependencies: | Superseder: | ||
Assigned To: | Nosy List: | gvanrossum, rbcollins | |
Priority: | normal | Keywords: |
Created on 2014-11-25 02:06 by rbcollins, last changed 2022-04-11 14:58 by admin. This issue is now closed.
Messages (4) | ||
---|---|---|
msg231629 - (view) | Author: Robert Collins (rbcollins) * ![]() |
Date: 2014-11-25 02:06 |
From https://github.com/testing-cabal/testtools/issues/111 - any code that is data dependent can be hard to diagnose from a backtrace alone. Many unittest and server environments address this by doing custom tracebacks that include locals. To address this in unittest, we need to add a similar capacity to traceback, and then use it from unittest (as we can't just depend on a module from PyPI in the stdlib). This issue is for the unittest part of it. For the traceback dependency see http://bugs.python.org/issue22936 . | ||
msg231735 - (view) | Author: Guido van Rossum (gvanrossum) * ![]() |
Date: 2014-11-26 23:56 |
Note that IIRC py.test (a 3rd party module) will show you additional information in the traceback. SO it is definitely possible. | ||
msg231737 - (view) | Author: Guido van Rossum (gvanrossum) * ![]() |
Date: 2014-11-27 00:03 |
Sorry, I missed the part where you said "we can't depend on PyPI". There already is something in the stdlib that may be close enough to what you're looking for -- checkout cgitb.py. The following might even work: import cgitb cgitb.enable(format='text') That code is very old and primarily meant for CGI scripts (that shows how old it is!) but it still works. | ||
msg238179 - (view) | Author: Robert Collins (rbcollins) * ![]() |
Date: 2015-03-16 03:19 |
Fixed (patch referenced 22936) |
History | |||
---|---|---|---|
Date | User | Action | Args |
2022-04-11 14:58:10 | admin | set | github: 67126 |
2015-03-16 03:19:32 | rbcollins | set | status: open -> closedresolution: fixedmessages: + |
2014-11-27 00:03:13 | gvanrossum | set | messages: + |
2014-11-26 23:56:11 | gvanrossum | set | nosy: + gvanrossummessages: + |
2014-11-25 02:06:22 | rbcollins | create |