chore: move AlreadyBuiltWheelError & NonPlatformWheelError to errors.py (#1920)

This commit is contained in:
Matthieu Darbois
2024-07-07 09:47:03 +02:00
committed by GitHub
parent 7e5a838a63
commit a4d24056ef
8 changed files with 45 additions and 49 deletions
+2 -1
View File
@@ -38,7 +38,7 @@ def test(tmp_path, capfd):
else:
expectation = does_not_raise()
with expectation:
with expectation as exc_info:
result = utils.cibuildwheel_run(
project_dir,
add_env={
@@ -49,6 +49,7 @@ def test(tmp_path, capfd):
captured = capfd.readouterr()
if num_builds > 1:
assert "Build failed because a wheel named" in captured.err
assert exc_info.value.returncode == 6
else:
# We only produced one wheel (currently Pyodide)
# check that it has the right name
+2 -1
View File
@@ -31,10 +31,11 @@ def test(tmp_path, capfd):
project_dir = tmp_path / "project"
pure_python_project.generate(project_dir)
with pytest.raises(subprocess.CalledProcessError):
with pytest.raises(subprocess.CalledProcessError) as exc_info:
print("produced wheels:", utils.cibuildwheel_run(project_dir))
captured = capfd.readouterr()
print("out", captured.out)
print("err", captured.err)
assert exc_info.value.returncode == 5
assert "Build failed because a pure Python wheel was generated" in captured.err