标签:style class blog code tar color
class TestCase: def run(self, result=None): if result is None:
result=self.defaultTestResult()
result.startTest(self) testMethod = getattr(self, self._testMethodName) try: try: self.setUp() except KeyboardInterrupt: raise except: result.addError(self, self._exc_info()) return ok = False n = 1 try: while n<=self.repeat or ok is False: try: testMethod() ok = True break except Exception as e: if n == self.repeat: raise self.failureException(str(e)) finally: n+=1 except self.failureException: result.addFailure(self, self._exc_info()) except KeyboardInterrupt: raise except: result.addError(self, self._exc_info()) try: self.tearDown() except KeyboardInterrupt: raise except: result.addError(self, self._exc_info()) ok = False if ok: result.addSuccess(self) finally: result.stopTest(self)
标签:style class blog code tar color
原文地址:http://www.cnblogs.com/timp/p/3789715.html