diff --git a/flask/testsuite/__init__.py b/flask/testsuite/__init__.py index 5ebc786e..addbb92b 100644 --- a/flask/testsuite/__init__.py +++ b/flask/testsuite/__init__.py @@ -157,8 +157,7 @@ class BetterLoader(unittest.TestLoader): all_tests.append(testcase) if not all_tests: - print >> sys.stderr, 'Error: could not find test case for "%s"' % name - sys.exit(1) + raise LookupError('could not find test case for "%s"' % name) if len(all_tests) == 1: return all_tests[0] diff --git a/run-tests.py b/run-tests.py index 7d44febc..0c8d0bdf 100644 --- a/run-tests.py +++ b/run-tests.py @@ -1,3 +1,6 @@ import unittest from flask.testsuite import BetterLoader -unittest.main(testLoader=BetterLoader(), defaultTest='suite') +try: + unittest.main(testLoader=BetterLoader(), defaultTest='suite') +except Exception, e: + print 'Error: %s' % e