Issue1705520
Created on 2007-04-23 03:56 by rbcollins, last changed 2009-05-12 14:32 by ajaksu2.
|
msg55078 - (view) |
Author: Robert Collins (rbcollins) |
Date: 2007-04-23 03:56 |
|
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)
|
|
msg61493 - (view) |
Author: Steve Purcell (purcell) |
Date: 2008-01-22 10:16 |
|
This is a good idea, but slightly messy.
A better solution would be for unittest to provide a decorator that
could be used to mark assertion functions. Internally, that decorator
may well work the way you describe.
Given a corresponding patch, someone with more time than myself may well
be willing to commit it.
|
|
| Date |
User |
Action |
Args |
| 2009-05-12 14:32:41 | ajaksu2 | set | nosy:
+ michael.foord
versions:
+ Python 2.7, Python 3.2, - Python 2.6 stage: test needed |
| 2008-01-22 10:16:14 | purcell | set | messages:
+ msg61493 |
| 2007-04-23 03:56:38 | rbcollins | create | |
|