fix: add suggestions to the TOML error message (#1205)

* fix: add suggestions to the TOML error message

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* Update cibuildwheel/options.py

Co-authored-by: Matthieu Darbois <mayeut@users.noreply.github.com>

Co-authored-by: Matthieu Darbois <mayeut@users.noreply.github.com>
This commit is contained in:
Henry Schreiner
2022-08-02 14:43:07 -04:00
committed by GitHub
co-authored by Matthieu Darbois
parent 9d170ac0f4
commit c234ff5f36
2 changed files with 50 additions and 22 deletions
+20 -1
View File
@@ -160,9 +160,28 @@ repairs-wheel-command = "repair-project-linux"
"""
)
with pytest.raises(ConfigOptionError):
with pytest.raises(ConfigOptionError) as excinfo:
OptionsReader(pyproject_toml, platform="linux")
assert "repair-wheel-command" in str(excinfo.value)
def test_underscores_in_key(tmp_path):
# Note that platform contents are only checked when running
# for that platform.
pyproject_toml = tmp_path / "pyproject.toml"
pyproject_toml.write_text(
"""
[tool.cibuildwheel]
repair_wheel_command = "repair-project-linux"
"""
)
with pytest.raises(ConfigOptionError) as excinfo:
OptionsReader(pyproject_toml, platform="linux")
assert "repair-wheel-command" in str(excinfo.value)
def test_unexpected_table(tmp_path):
pyproject_toml = tmp_path / "pyproject.toml"