# HG changeset patch # User Gregory Szorc # Date 1398035838 25200 # Node ID c42219733f303290d3446fd692243a49d21ef8b1 # Parent 12dd94e3210277756eae09e4e2fb822f3d99a02e run-tests: don't print results in unittest mode A subsequent patch will have unittest print tests for us. Don't perform old-style printing when in unittest mode. diff -r 12dd94e32102 -r c42219733f30 tests/run-tests.py --- a/tests/run-tests.py Sun Apr 20 15:53:25 2014 -0700 +++ b/tests/run-tests.py Sun Apr 20 16:17:18 2014 -0700 @@ -1315,6 +1315,9 @@ tests = [self._gettest(t, i, asunit=self.options.unittest) for i, t in enumerate(tests)] + failed = False + warned = False + if self.options.unittest: suite = TestSuite(self, tests=tests) verbosity = 1 @@ -1325,27 +1328,27 @@ else: self._executetests(tests) - failed = len(self.results['!']) - warned = len(self.results['~']) - tested = len(self.results['.']) + failed + warned - skipped = len(self.results['s']) - ignored = len(self.results['i']) + failed = len(self.results['!']) + warned = len(self.results['~']) + tested = len(self.results['.']) + failed + warned + skipped = len(self.results['s']) + ignored = len(self.results['i']) - print - if not self.options.noskips: - for s in self.results['s']: - print "Skipped %s: %s" % s - for s in self.results['~']: - print "Warned %s: %s" % s - for s in self.results['!']: - print "Failed %s: %s" % s - self._checkhglib("Tested") - print "# Ran %d tests, %d skipped, %d warned, %d failed." % ( - tested, skipped + ignored, warned, failed) - if self.results['!']: - print 'python hash seed:', os.environ['PYTHONHASHSEED'] - if self.options.time: - self._outputtimes() + print + if not self.options.noskips: + for s in self.results['s']: + print "Skipped %s: %s" % s + for s in self.results['~']: + print "Warned %s: %s" % s + for s in self.results['!']: + print "Failed %s: %s" % s + self._checkhglib("Tested") + print "# Ran %d tests, %d skipped, %d warned, %d failed." % ( + tested, skipped + ignored, warned, failed) + if self.results['!']: + print 'python hash seed:', os.environ['PYTHONHASHSEED'] + if self.options.time: + self._outputtimes() if self.options.anycoverage: self._outputcoverage()