Message195444
A few times now I've seen people write something that overrides and re-implements the unittest.TestCase run() method, copying most of the implementation but adding one feature:
The ability for pdb.post_mortem() to be called after every phase of execution iff an exception/error was caught (setUp(), the testMethod() call itself and tearDown()).
I really hate seeing people have to copy the run method implementation and modify it.
We could support this either by adding another debugHook() method to the TestCase API. Proposal: it gets called within the except: clause surrounding each phase of test execution.
Turning on support for automatic pdb.post_mortem(), typically controlled via a flag or other environment configurable as it isn't desirable during automation:
def debugHook(self):
if SOMETHING_SAYS_TO_ENABLE_THIS:
pdb.post_mortem()
no more copy and pasting the run() method. |
|
Date |
User |
Action |
Args |
2013-08-16 23:45:52 | gregory.p.smith | set | recipients:
+ gregory.p.smith, michael.foord |
2013-08-16 23:45:52 | gregory.p.smith | set | messageid: <1376696752.64.0.473845221037.issue18765@psf.upfronthosting.co.za> |
2013-08-16 23:45:52 | gregory.p.smith | link | issue18765 messages |
2013-08-16 23:45:52 | gregory.p.smith | create | |
|