Skip to content

Commit 4f705b7

Browse files
authored
Merge pull request #177 from joerick/failing-test-test
Add failing test check
2 parents ee2a908 + bbecbe4 commit 4f705b7

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

test/02_test/cibuildwheel_test.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import os
1+
import os, subprocess
2+
import pytest
23
import utils
34

45
def test():
@@ -35,3 +36,16 @@ def test_extras_require():
3536
expected_wheels = utils.expected_wheels('spam', '0.1.0')
3637
actual_wheels = os.listdir('wheelhouse')
3738
assert set(actual_wheels) == set(expected_wheels)
39+
40+
41+
def test_failing_test():
42+
'''Ensure a failing test causes cibuildwheel to error out and exit'''
43+
project_dir = os.path.dirname(__file__)
44+
45+
with pytest.raises(subprocess.CalledProcessError):
46+
utils.cibuildwheel_run(project_dir, add_env={
47+
'CIBW_TEST_COMMAND': 'false',
48+
})
49+
50+
assert len(os.listdir('wheelhouse'))
51+

0 commit comments

Comments
 (0)