Ensure tests are up-to-date with master

This commit is contained in:
Joe Rickerby
2020-05-02 22:42:35 +01:00
parent 3b35882f87
commit 007be7aea7
8 changed files with 94 additions and 117 deletions
+29 -32
View File
@@ -26,55 +26,52 @@ def test(tmpdir):
project_with_a_test.generate(project_dir)
# build and test the wheels
actual_wheels = utils.cibuildwheel_run(
project_dir,
add_env={
"CIBW_TEST_REQUIRES": "nose",
# the 'false ||' bit is to ensure this command runs in a shell on
# mac/linux.
"CIBW_TEST_COMMAND": "false || nosetests {project}/test",
"CIBW_TEST_COMMAND_WINDOWS": "nosetests {project}/test",
},
)
actual_wheels = utils.cibuildwheel_run(project_dir, add_env={
'CIBW_TEST_REQUIRES': 'nose',
# the 'false ||' bit is to ensure this command runs in a shell on
# mac/linux.
'CIBW_TEST_COMMAND': 'false || nosetests {project}/test',
'CIBW_TEST_COMMAND_WINDOWS': 'COLOR 00 || nosetests {project}/test',
})
# also check that we got the right wheels
expected_wheels = utils.expected_wheels("spam", "0.1.0")
expected_wheels = utils.expected_wheels('spam', '0.1.0')
assert set(actual_wheels) == set(expected_wheels)
def test_extras_require(tmpdir):
project_dir = str(tmpdir)
project_with_a_test.generate(project_dir)
# build and test the wheels
actual_wheels = utils.cibuildwheel_run(
project_dir,
add_env={
"CIBW_TEST_EXTRAS": "test",
"CIBW_TEST_COMMAND": "nosetests {project}/test",
},
)
actual_wheels = utils.cibuildwheel_run(project_dir, add_env={
'CIBW_TEST_EXTRAS': 'test',
# the 'false ||' bit is to ensure this command runs in a shell on
# mac/linux.
'CIBW_TEST_COMMAND': 'false || nosetests {project}/test',
'CIBW_TEST_COMMAND_WINDOWS': 'COLOR 00 || nosetests {project}/test',
})
# also check that we got the right wheels
expected_wheels = utils.expected_wheels("spam", "0.1.0")
expected_wheels = utils.expected_wheels('spam', '0.1.0')
assert set(actual_wheels) == set(expected_wheels)
def test_failing_test(tmpdir):
def test_failing_test(tmp_path):
"""Ensure a failing test causes cibuildwheel to error out and exit"""
project_dir = str(tmpdir)
project_dir = str(tmp_path / 'project')
output_dir = str(tmp_path / 'output')
project_with_a_test.generate(project_dir)
with pytest.raises(subprocess.CalledProcessError):
utils.cibuildwheel_run(
project_dir,
add_env={
"CIBW_TEST_COMMAND": "false",
# manylinux1 has a version of bash that's been shown to have
# problems with this, so let's check that.
"CIBW_MANYLINUX_I686_IMAGE": "manylinux1",
"CIBW_MANYLINUX_X86_64_IMAGE": "manylinux1",
},
)
utils.cibuildwheel_run(project_dir, output_dir=output_dir, add_env={
'CIBW_TEST_COMMAND': 'false',
# manylinux1 has a version of bash that's been shown to have
# problems with this, so let's check that.
'CIBW_MANYLINUX_I686_IMAGE': 'manylinux1',
'CIBW_MANYLINUX_X86_64_IMAGE': 'manylinux1',
})
assert len(os.listdir(output_dir)) == 0
assert len(os.listdir("wheelhouse"))