Mercurial > hg
comparison tests/run-tests.py @ 21455:0f0bace82149
run-tests: move err file writing to tearDown()
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Mon, 21 Apr 2014 09:30:11 -0700 |
parents | 046587aa1c8a |
children | a06a4142ad1f |
comparison
equal
deleted
inserted
replaced
21454:046587aa1c8a | 21455:0f0bace82149 |
---|---|
513 elif ret: | 513 elif ret: |
514 self._result = self.fail(describe(ret), ret) | 514 self._result = self.fail(describe(ret), ret) |
515 else: | 515 else: |
516 self._result = self.success() | 516 self._result = self.success() |
517 | 517 |
518 if (ret != 0 or out != self._refout) and not self._skipped \ | |
519 and not options.debug: | |
520 f = open(self._errpath, 'wb') | |
521 for line in out: | |
522 f.write(line) | |
523 f.close() | |
524 | |
525 if not self._unittest: | 518 if not self._unittest: |
526 self.tearDown() | 519 self.tearDown() |
527 | 520 |
528 return self._result | 521 return self._result |
529 | 522 |
530 def tearDown(self): | 523 def tearDown(self): |
531 """Tasks to perform after run().""" | 524 """Tasks to perform after run().""" |
532 if not self._options.keep_tmpdir: | 525 if not self._options.keep_tmpdir: |
533 shutil.rmtree(self._testtmp) | 526 shutil.rmtree(self._testtmp) |
527 | |
528 if (self._ret != 0 or self._out != self._refout) and not self._skipped \ | |
529 and not self._options.debug and self._out: | |
530 f = open(self._errpath, 'wb') | |
531 for line in self._out: | |
532 f.write(line) | |
533 f.close() | |
534 | 534 |
535 vlog("# Ret was:", self._ret) | 535 vlog("# Ret was:", self._ret) |
536 | 536 |
537 # Don't print progress in unittest mode because that is handled | 537 # Don't print progress in unittest mode because that is handled |
538 # by TestResult. | 538 # by TestResult. |