From a3b56774ac44ee53bdce648e57976b97bff2ba13 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Sun, 30 Oct 2016 13:39:08 -0400 Subject: [PATCH] Exit with a non-zero code when the test suite fails. --- test/__init__.py | 2 +- test/__main__.py | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) 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) -- 2.44.2