@@ -584,12 +584,22 @@ def test_parse_constraint_with_white_space_padding(
584584 assert parse_constraint (constraint ) == expected
585585
586586
587- def test_parse_marker_constraint_does_not_allow_invalid_version () -> None :
587+ @pytest .mark .parametrize ("constraint" , ["4.9.253-tegra" , "2022Server" ])
588+ def test_parse_marker_constraint_does_not_allow_invalid_version (
589+ constraint : str ,
590+ ) -> None :
588591 with pytest .raises (ParseConstraintError ):
589- parse_marker_version_constraint ("4.9.253-tegra" )
592+ parse_marker_version_constraint (constraint )
590593
591594
592- def test_parse_marker_constraint_does_allow_invalid_version_if_requested () -> None :
593- assert parse_marker_version_constraint (
594- "4.9.253-tegra" , pep440 = False
595- ) == Version .from_parts (4 , 9 , 253 , local = "tegra" )
595+ @pytest .mark .parametrize (
596+ ("constraint" , "expected" ),
597+ [
598+ ("4.9.253-tegra" , Version .from_parts (4 , 9 , 253 , local = "tegra" )),
599+ ("2022Server" , Version .from_parts (2022 , local = "Server" )),
600+ ],
601+ )
602+ def test_parse_marker_constraint_does_allow_invalid_version_if_requested (
603+ constraint : str , expected : VersionConstraint
604+ ) -> None :
605+ assert parse_marker_version_constraint (constraint , pep440 = False ) == expected
0 commit comments