|
| 1 | +import os |
1 | 2 | import sys |
2 | 3 | import tomllib |
3 | 4 | from fnmatch import fnmatch |
@@ -141,6 +142,52 @@ def test_empty_selector(monkeypatch): |
141 | 142 | assert e.value.code == 3 |
142 | 143 |
|
143 | 144 |
|
| 145 | +@pytest.mark.usefixtures("platform", "intercepted_build_args") |
| 146 | +def test_riscv64_warning1(monkeypatch, capsys): |
| 147 | + monkeypatch.setenv("CIBW_ENABLE", "cpython-experimental-riscv64") |
| 148 | + |
| 149 | + main() |
| 150 | + |
| 151 | + _, err = capsys.readouterr() |
| 152 | + print(err) |
| 153 | + assert "'cpython-experimental-riscv64' enable is deprecated" in err |
| 154 | + |
| 155 | + |
| 156 | +@pytest.mark.usefixtures("platform", "intercepted_build_args") |
| 157 | +def test_riscv64_warning2(monkeypatch, capsys, tmp_path): |
| 158 | + local_path = tmp_path / "tmp_project" |
| 159 | + os.mkdir(local_path) # noqa:PTH102 Path.mkdir has been monkeypatched already |
| 160 | + local_path.joinpath("setup.py").touch() |
| 161 | + |
| 162 | + monkeypatch.setattr( |
| 163 | + sys, "argv", ["cibuildwheel", "--only", "cp313-manylinux_riscv64", str(local_path)] |
| 164 | + ) |
| 165 | + monkeypatch.setenv("CIBW_ENABLE", "cpython-experimental-riscv64") |
| 166 | + |
| 167 | + main() |
| 168 | + |
| 169 | + _, err = capsys.readouterr() |
| 170 | + print(err) |
| 171 | + assert "'cpython-experimental-riscv64' enable is deprecated" in err |
| 172 | + |
| 173 | + |
| 174 | +@pytest.mark.usefixtures("platform", "intercepted_build_args") |
| 175 | +def test_riscv64_no_warning(monkeypatch, capsys, tmp_path): |
| 176 | + local_path = tmp_path / "tmp_project" |
| 177 | + os.mkdir(local_path) # noqa:PTH102 Path.mkdir has been monkeypatched already |
| 178 | + local_path.joinpath("setup.py").touch() |
| 179 | + |
| 180 | + monkeypatch.setattr( |
| 181 | + sys, "argv", ["cibuildwheel", "--only", "cp313-manylinux_riscv64", str(local_path)] |
| 182 | + ) |
| 183 | + |
| 184 | + main() |
| 185 | + |
| 186 | + _, err = capsys.readouterr() |
| 187 | + print(err) |
| 188 | + assert "'cpython-experimental-riscv64' enable is deprecated" not in err |
| 189 | + |
| 190 | + |
144 | 191 | @pytest.mark.parametrize( |
145 | 192 | ("architecture", "image", "full_image"), |
146 | 193 | [ |
|
0 commit comments