Stop pytest on first failing test

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.
This commit is contained in:
Chris Hill-Scott
2018-02-14 11:54:40 +00:00
parent 2049e75210
commit e87ed0f68a

View File

@@ -31,5 +31,5 @@ flake8 .
display_result $? 1 "Code style check"
# run with four concurrent threads
py.test --cov=app --cov-report=term-missing tests/ --junitxml=test_results.xml -n 4 -v
py.test --cov=app --cov-report=term-missing tests/ --junitxml=test_results.xml -n4 -v -x
display_result $? 2 "Unit tests"