The most immediate cause of this issue is code in testtools.testresult.real.ThreadsafeForwardingResult like:
def addError(self, test, err=None, details=None): self.semaphore.acquire() try: self.result.startTest(test) self.result.addError(test, err, details=details) self.result.stopTest(test) finally: self.semaphore.release()
It's written like that to prevent different test results being interleaved in the output, but as a side effect means start/add/stop happen all at the same time from the perspective of the test result that's actually doing the timing.
The most immediate cause of this issue is code in testtools. testresult. real.Threadsafe ForwardingResul t like:
def addError(self, test, err=None, details=None):
self.semaphore .acquire( )
self. result. startTest( test)
self. result. addError( test, err, details=details)
self. result. stopTest( test)
self. semaphore. release( )
try:
finally:
It's written like that to prevent different test results being interleaved in the output, but as a side effect means start/add/stop happen all at the same time from the perspective of the test result that's actually doing the timing.