Message243694
I have a situation where it would be really helpful to know in my cleanup routine whether or not the test failed. The situation is this: I'm running a command in a subprocess, and sometimes it writes output to stderr that I normally want to ignore. But if the test fails, I'd like my cleanup routine (that shuts down the test subprocess) to print out the stderr, because usually the information as to what went wrong is in stderr.
I figure out this hack (for python3.4):
for what, result in self._outcome.errors:
if what._testMethodName == self._testMethodName and result:
print(self.p.stderr.read().decode())
but obviously that uses non-public APIs. |
|
Date |
User |
Action |
Args |
2015-05-20 21:01:55 | r.david.murray | set | recipients:
+ r.david.murray, rbcollins, ezio.melotti, michael.foord |
2015-05-20 21:01:55 | r.david.murray | set | messageid: <1432155715.32.0.956645145974.issue24249@psf.upfronthosting.co.za> |
2015-05-20 21:01:55 | r.david.murray | link | issue24249 messages |
2015-05-20 21:01:54 | r.david.murray | create | |
|