From bbecbe43ec58aed84c57872c0228b0a00301ae4c Mon Sep 17 00:00:00 2001 From: Joe Rickerby Date: Sun, 20 Oct 2019 20:45:25 +0100 Subject: [PATCH] Add failing test check --- test/02_test/cibuildwheel_test.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/test/02_test/cibuildwheel_test.py b/test/02_test/cibuildwheel_test.py index 54973573a..99324e876 100644 --- a/test/02_test/cibuildwheel_test.py +++ b/test/02_test/cibuildwheel_test.py @@ -1,4 +1,5 @@ -import os +import os, subprocess +import pytest import utils def test(): @@ -35,3 +36,16 @@ def test_extras_require(): expected_wheels = utils.expected_wheels('spam', '0.1.0') actual_wheels = os.listdir('wheelhouse') assert set(actual_wheels) == set(expected_wheels) + + +def test_failing_test(): + '''Ensure a failing test causes cibuildwheel to error out and exit''' + project_dir = os.path.dirname(__file__) + + with pytest.raises(subprocess.CalledProcessError): + utils.cibuildwheel_run(project_dir, add_env={ + 'CIBW_TEST_COMMAND': 'false', + }) + + assert len(os.listdir('wheelhouse')) +