From 9f275d2a0b4cfe911969eb47320b1eb6c8dd51ba Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Wed, 14 Feb 2018 11:50:51 +0000 Subject: [PATCH] Stop pytest on first failing test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If a PR is going to fail because tests aren’t passing then you: - should know about it as quick as possible - shouldn’t waste precious Jenkins CPU running subsequent tests This commit adds the `-x` flag to pytest, which stops the test run as soon as one failing test is discovered. --- scripts/run_tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/run_tests.sh b/scripts/run_tests.sh index d8d6b5a39..0cad292ee 100755 --- a/scripts/run_tests.sh +++ b/scripts/run_tests.sh @@ -35,5 +35,5 @@ npm test display_result $? 2 "Front end code style check" ## Code coverage -py.test -n4 --cov=app --cov-report=term-missing tests/ --junitxml=test_results.xml --strict +py.test -n4 -x --cov=app --cov-report=term-missing tests/ --junitxml=test_results.xml --strict display_result $? 3 "Code coverage"