|
7 | 7 | basic_project = test_projects.new_c_project()
|
8 | 8 |
|
9 | 9 |
|
10 |
| -def test(tmp_path, capfd, request): |
| 10 | +def test_podman(tmp_path, capfd, request): |
11 | 11 | if utils.platform != "linux":
|
12 | 12 | pytest.skip("the test is only relevant to the linux build")
|
13 | 13 |
|
@@ -38,3 +38,29 @@ def test(tmp_path, capfd, request):
|
38 | 38 | # check that stdout is bring passed-though from container correctly
|
39 | 39 | captured = capfd.readouterr()
|
40 | 40 | assert "test log statement from before-all" in captured.out
|
| 41 | + |
| 42 | + |
| 43 | +def test_create_args(tmp_path, capfd): |
| 44 | + if utils.platform != "linux": |
| 45 | + pytest.skip("the test is only relevant to the linux build") |
| 46 | + |
| 47 | + project_dir = tmp_path / "project" |
| 48 | + basic_project.generate(project_dir) |
| 49 | + |
| 50 | + # build a manylinux wheel, using create_args to set an environment variable |
| 51 | + actual_wheels = utils.cibuildwheel_run( |
| 52 | + project_dir, |
| 53 | + add_env={ |
| 54 | + "CIBW_BUILD": "cp310-manylinux_*", |
| 55 | + "CIBW_BEFORE_ALL": "echo TEST_CREATE_ARGS is set to $TEST_CREATE_ARGS", |
| 56 | + "CIBW_CONTAINER_ENGINE": "docker; create_args: --env=TEST_CREATE_ARGS=itworks", |
| 57 | + }, |
| 58 | + ) |
| 59 | + |
| 60 | + expected_wheels = [ |
| 61 | + w for w in utils.expected_wheels("spam", "0.1.0") if ("cp310-manylinux" in w) |
| 62 | + ] |
| 63 | + assert set(actual_wheels) == set(expected_wheels) |
| 64 | + |
| 65 | + captured = capfd.readouterr() |
| 66 | + assert "TEST_CREATE_ARGS is set to itworks" in captured.out |
0 commit comments