Commit 24ed0537 authored by Andreas Jung's avatar Andreas Jung

Running testrunner with option -d on a directory not containing

any suitable tests produced an ugly traceback. Instead the
testrunner now prints a warning to stderr.
parent 7006502f
......@@ -90,8 +90,11 @@ class TestRunner:
return 0
def runSuite(self, suite):
runner=unittest.TextTestRunner(stream=sys.stderr, verbosity=self.verbosity)
self.results.append(runner.run(suite))
if suite:
runner=unittest.TextTestRunner(stream=sys.stderr, verbosity=self.verbosity)
self.results.append(runner.run(suite))
else:
self.report('No suitable tests found')
def report(self, message):
sys.stderr.write( '%s\n' % message )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment