From: Michael Orlitzky Date: Sun, 30 Oct 2016 17:39:08 +0000 (-0400) Subject: Exit with a non-zero code when the test suite fails. X-Git-Tag: 0.1.0~114 X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=a3b56774ac44ee53bdce648e57976b97bff2ba13;p=dunshire.git Exit with a non-zero code when the test suite fails. --- diff --git a/test/__init__.py b/test/__init__.py index 4241453..bbcd4ab 100644 --- a/test/__init__.py +++ b/test/__init__.py @@ -36,4 +36,4 @@ def run_suite(suite): packages. """ runner = TextTestRunner(verbosity=1) - runner.run(suite) + return runner.run(suite) diff --git a/test/__main__.py b/test/__main__.py index 6a8af8a..26dfc57 100644 --- a/test/__main__.py +++ b/test/__main__.py @@ -3,4 +3,9 @@ An implementation of __main__() that allows us to "run this module." """ from test import build_suite, run_suite -run_suite(build_suite()) +result = run_suite(build_suite()) + +if result.wasSuccessful(): + exit(0) +else: + exit(1)