Skip to content

Commit

Permalink
test symmetry of intersection
Browse files Browse the repository at this point in the history
  • Loading branch information
dimbleby authored and bostonrwalker committed Aug 29, 2022
1 parent d0f7ab2 commit 00c34e6
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions tests/version/test_markers.py
Original file line number Diff line number Diff line change
Expand Up @@ -612,18 +612,21 @@ def test_marker_union_intersect_marker_union_drops_unnecessary_markers() -> None


def test_marker_union_intersect_multi_marker() -> None:
m = parse_marker('sys_platform == "darwin" or python_version < "3.4"')
m1 = parse_marker('sys_platform == "darwin" or python_version < "3.4"')
m2 = parse_marker('implementation_name == "cpython" and os_name == "Windows"')

intersection = m.intersect(
parse_marker('implementation_name == "cpython" and os_name == "Windows"')
)
assert (
str(intersection)
== 'implementation_name == "cpython" and os_name == "Windows" and sys_platform'
expected = (
'implementation_name == "cpython" and os_name == "Windows" and sys_platform'
' == "darwin" or implementation_name == "cpython" and os_name == "Windows"'
' and python_version < "3.4"'
)

intersection = m1.intersect(m2)
assert str(intersection) == expected

intersection = m2.intersect(m1)
assert str(intersection) == expected


def test_marker_union_union_with_union() -> None:
m = parse_marker('sys_platform == "darwin" or python_version < "3.4"')
Expand Down

0 comments on commit 00c34e6

Please sign in to comment.