From 38d678809f02197330f659b03f9bd76d0ab929eb Mon Sep 17 00:00:00 2001 From: len0rd Date: Wed, 16 Jan 2019 08:59:51 -0700 Subject: [PATCH] unittests now exit 1 when a test fails --- .travis.yml | 2 +- README.md | 2 +- server/src/test.py | 10 +++++++--- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 628478a..d3218f4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,7 @@ language: python sudo: required dist: xenial services: postgresql -before_script: +before_script: # setup postgres db - psql -f server/setup/internal/setup_database.sql -U postgres python: - "3.5" diff --git a/README.md b/README.md index 7377a9d..ba644f7 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Imaging +# Imaging [![Build Status](https://travis-ci.com/BYU-AUVSI/imaging.png)](https://travis-ci.com/BYU-AUVSI/imaging) This package contains all the code used by the imaging subsystem. diff --git a/server/src/test.py b/server/src/test.py index 58991de..82aa125 100644 --- a/server/src/test.py +++ b/server/src/test.py @@ -1,6 +1,10 @@ #!/usr/bin/env python -import unittest +import unittest, sys -if __name__ == "__main__": +def main(): suite = unittest.TestLoader().discover('.', pattern = "*_test.py") - unittest.TextTestRunner(verbosity=2).run(suite) \ No newline at end of file + results = unittest.TextTestRunner(verbosity=2).run(suite) + sys.exit(not results.wasSuccessful()) + +if __name__ == "__main__": + main() \ No newline at end of file