[Zope-Checkins] CVS: Zope/utilities - testrunner.py:1.28
Andreas Jung
andreas@digicool.com
Tue, 3 Sep 2002 13:12:31 -0400
Update of /cvs-repository/Zope/utilities
In directory cvs.zope.org:/tmp/cvs-serv24491/utilities
Modified Files:
testrunner.py
Log Message:
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.
=== Zope/utilities/testrunner.py 1.27 => 1.28 ===
--- Zope/utilities/testrunner.py:1.27 Wed Aug 14 17:22:57 2002
+++ Zope/utilities/testrunner.py Tue Sep 3 13:12:31 2002
@@ -90,8 +90,11 @@
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 )