summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Albrecht <andreas.albrecht@prounix.de>2010-01-11 09:27:01 +0100
committerAndreas Albrecht <andreas.albrecht@prounix.de>2010-01-11 09:27:01 +0100
commitb252592eb40263994317d88ced43ddc4669a4975 (patch)
tree730eb4062d69f6e8645fd453e2ce13aac69bb5ba
parentacea845a7f77158bb12d9e35ff56698d769ad947 (diff)
downloadsqlparse-b252592eb40263994317d88ced43ddc4669a4975.tar.gz
Fix return code when running unittests.
-rwxr-xr-xtests/run_tests.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/run_tests.py b/tests/run_tests.py
index 7c01d49..9a532fc 100755
--- a/tests/run_tests.py
+++ b/tests/run_tests.py
@@ -31,7 +31,7 @@ def main(args):
modname = os.path.splitext(fname)[0]
mod = __import__(os.path.splitext(fname)[0])
suite.addTests(loader.loadTestsFromModule(mod))
- unittest.TextTestRunner(verbosity=2).run(suite)
+ return unittest.TextTestRunner(verbosity=2).run(suite)
@@ -44,4 +44,9 @@ if __name__ == '__main__':
prof.runcall(main, args)
prof.close()
else:
- main(args)
+ result = main(args)
+ if not result.wasSuccessful():
+ return_code = 1
+ else:
+ return_code = 0
+ sys.exit(return_code)