From 298a893ec5133db88ecb5d03457f9bb114b7339c Mon Sep 17 00:00:00 2001 From: Mario de Frutos Date: Wed, 9 Dec 2015 13:13:24 +0100 Subject: [PATCH] Check for a properly exit if the tests failed --- test/run_tests.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/test/run_tests.py b/test/run_tests.py index 3e702e4..d3bb62b 100644 --- a/test/run_tests.py +++ b/test/run_tests.py @@ -3,6 +3,7 @@ import sys import time import subprocess import os +import re from helpers.import_helper import ImportHelper @@ -46,8 +47,16 @@ def usage(): def execute_tests(): - process = subprocess.Popen(["nosetests", "--where=integration/"]) - process.wait() + process = subprocess.Popen( + ["nosetests", "--where=integration/"], + stdout=subprocess.PIPE, + stderr=subprocess.PIPE + ) + out, err = process.communicate() + print err + regexp = re.compile(r'FAILED \(.*\)') + if regexp.search(err) is not None: + sys.exit(1) def set_environment_variables(username, api_key, table_name, host):