msg231628 - (view) |
Author: Robert Collins (rbcollins) *  |
Date: 2014-11-25 02:05 |
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). |
|
|
msg231630 - (view) |
Author: Robert Collins (rbcollins) *  |
Date: 2014-11-25 02:07 |
See http://bugs.python.org/issue22936 for the unittest aspect of this. |
|
|
msg231738 - (view) |
Author: Guido van Rossum (gvanrossum) *  |
Date: 2014-11-27 00:03 |
Check out the cgitb stdlib module. |
|
|
msg234799 - (view) |
Author: Robert Collins (rbcollins) *  |
Date: 2015-01-26 23:48 |
First cut implementation. I'm sure there is lots we can add, but this will make things nicer in and of itself. Thanks for the pointer to cgitb, I've skimmed it and its definitely much more comprehensive. I'm not entirely sure about the best way to glue it and the new traceback API together; or even if thats needed. |
|
|
msg235366 - (view) |
Author: Robert Collins (rbcollins) *  |
Date: 2015-02-03 23:29 |
updated with the latest 17911 patch basis. |
|
|
msg237218 - (view) |
Author: Robert Collins (rbcollins) *  |
Date: 2015-03-04 23:14 |
And now updated to HEAD as 17911 has been committed. |
|
|
msg237243 - (view) |
Author: Alyssa Coghlan (ncoghlan) *  |
Date: 2015-03-05 06:48 |
Latest patch (issue-22936-4.patch) looks good to me! |
|
|
msg237244 - (view) |
Author: Roundup Robot (python-dev)  |
Date: 2015-03-05 07:29 |
New changeset 50741316dd3a by Robert Collins in branch 'default': Issue #22936: Make it possible to show local variables in tracebacks. https://hg.python.org/cpython/rev/50741316dd3a |
|
|
msg237246 - (view) |
Author: Ezio Melotti (ezio.melotti) *  |
Date: 2015-03-05 08:07 |
In the patch you made some args kw-only. Isn't that backward incompatible in case someone was passing them by position? |
|
|
msg237262 - (view) |
Author: Alyssa Coghlan (ncoghlan) *  |
Date: 2015-03-05 14:06 |
It's only the new APIs just introduced in issue #17911 that changed to kwonly arguments. We missed that they should really be kwonly in the original review, but it become more obvious in this patch, as it added a second feature toggle to indicate whether or not to capture the locals. |
|
|
msg237267 - (view) |
Author: Ezio Melotti (ezio.melotti) *  |
Date: 2015-03-05 15:08 |
You are right -- I didn't notice the versionadded in the docs. Sorry for the noise. |
|
|
msg237298 - (view) |
Author: Robert Collins (rbcollins) *  |
Date: 2015-03-05 22:39 |
No worries. BTW there is one more patch needed to close this issue - adding the feature to unittest. I'm working that up now. |
|
|
msg237308 - (view) |
Author: Robert Collins (rbcollins) *  |
Date: 2015-03-06 00:02 |
And the unittest patch. |
|
|
msg237314 - (view) |
Author: Roundup Robot (python-dev)  |
Date: 2015-03-06 00:46 |
New changeset b4a26b28f5b3 by Robert Collins in branch 'default': Issue #22936: Allow showing local variables in unittest errors. https://hg.python.org/cpython/rev/b4a26b28f5b3 |
|
|
msg237320 - (view) |
Author: Alyssa Coghlan (ncoghlan) *  |
Date: 2015-03-06 02:15 |
I just filed issue #23597 as a potential further follow-up to this, which would be to also add support for displaying local variables directly to the logging module. However, that has some additional security implications, so I'm entirely convinced it's a good idea yet. See the new RFE for more details. |
|
|
msg237326 - (view) |
Author: Mark Lawrence (BreamoreBoy) * |
Date: 2015-03-06 02:36 |
"...so I'm *NOT* entirely convinced..."? :) |
|
|
msg249169 - (view) |
Author: Robert Collins (rbcollins) *  |
Date: 2015-08-26 00:13 |
This itself is fixed. |
|
|