Skip to content

Commit 7f9863b

Browse files
committed
check invalid versions raise
1 parent 9cfadc7 commit 7f9863b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

minimum_versions/tests/test_environments.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,3 +233,8 @@ def test_parse_spec(self, name, version_text, expected_spec, expected_warnings):
233233
assert actual_spec == expected_spec
234234
assert actual_name == name
235235
assert actual_warnings == expected_warnings
236+
237+
@pytest.mark.parametrize("version_text", ("~1.3", "^2.1", "<1.1"))
238+
def test_parse_spec_error(self, version_text):
239+
with pytest.raises(ValueError, match="Unknown version format: .*"):
240+
environments.pixi.parse_spec("package", version_text)

0 commit comments

Comments
 (0)