Skip to content

Commit

Permalink
Fix a typo and improve tests
Browse files Browse the repository at this point in the history
Co-authored-by: David Zaslavsky <[email protected]>
  • Loading branch information
ichard26 and diazona committed Jul 6, 2024
1 parent 0a13436 commit 2ce09d9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/packaging/markers.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ def _eval_op(lhs: str, op: Op, rhs: str) -> bool:
return spec.contains(lhs, prereleases=True)
except InvalidVersion:
# Even though there is PEP 440 defined behaviour for the
# right side, fallback as the left left is not a valid
# right side, fallback as the left side is not a valid
# version.
pass

Expand Down
5 changes: 3 additions & 2 deletions tests/test_markers.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,8 @@ def test_python_full_version_untagged(self):
("platform_release >= '20.0'", {"platform_release": "21-foobar"}, True),
("platform_release >= '8'", {"platform_release": "6.7.0-gentoo"}, False),
("platform_version == '27'", {"platform_version": "weird string"}, False),
# This looks weird, but is expected as per Python's lexicographical order.
("platform_version >= '10'", {"platform_version": "6.7.0-gentoo"}, True),
(
"implementation_version == '3.*'",
{"implementation_version": "2_private"},
Expand All @@ -420,5 +422,4 @@ def test_valid_specifier_invalid_version_fallback_to_python(
left operand is not a valid version, fallback to Python string
comparison behaviour.
"""
args = [] if environment is None else [environment]
assert Marker(marker_string).evaluate(*args) == expected
assert Marker(marker_string).evaluate(environment) == expected

0 comments on commit 2ce09d9

Please sign in to comment.