[ python-Feature Requests-1705520 ] pyunit should allow __unittest in locals to trim stackframes

SourceForge.net noreply at sourceforge.net
Mon Apr 23 05:56:38 CEST 2007


Feature Requests item #1705520, was opened at 2007-04-23 13:56
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=355470&aid=1705520&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: Python 2.6
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Robert Collins (rbcollins)
Assigned to: Nobody/Anonymous (nobody)
Summary: pyunit should allow __unittest in locals to trim stackframes

Initial Comment:
pyunit looks for __unittest = 1 in the globals of functions in an assertion stacktrace. This is used to trim the trace so that unittest implementation methods do  not show up.

It would be great if it looked in the locals of the frame as well, as this would allow subclasses of TestCase that add new assertFOO methods to have them filtered in the same manner.

e.g. (bad example :))
def assertComplexState(self, inputs):
    __unittest = 1
    self.assertEqual('42', inputs[0], 'the input %s is not the right answer' % inputs)



----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=355470&aid=1705520&group_id=5470


More information about the Python-bugs-list mailing list