Author r.david.murray
Recipients ezio.melotti, michael.foord, r.david.murray, rbcollins
Date 2015-05-20.21:01:54
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1432155715.32.0.956645145974.issue24249@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2015-05-20 21:01:55r.david.murraysetrecipients: + r.david.murray, rbcollins, ezio.melotti, michael.foord
2015-05-20 21:01:55r.david.murraysetmessageid: <1432155715.32.0.956645145974.issue24249@psf.upfronthosting.co.za>
2015-05-20 21:01:55r.david.murraylinkissue24249 messages
2015-05-20 21:01:54r.david.murraycreate