def __call__(self, result=None):
if result is None: result = self.defaultTestResult()
writer = CaptureWriter()
#self._preTest()
writer.capture()
try:
unittest.FunctionTestCase.__call__(self, result)
if getattr(self, "do_leak_tests", 0) and hasattr(sys, "gettotalrefcount"):
self.run_leak_tests(result)
finally:
writer.release()
#self._postTest(result)
output = writer.get_captured()
self.checkOutput(output, result)
if result.showAll:
print output
评论列表
文章目录