Skip to content

Commit

Permalink
tests: make tests forward compatible with simplified marker simplific…
Browse files Browse the repository at this point in the history
…ation (#7136)

(cherry picked from commit 0c8e5b4)
  • Loading branch information
dimbleby authored and radoering committed Dec 11, 2022
1 parent 8921a60 commit f8e24fc
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions tests/repositories/test_pypi_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,18 @@ def test_package() -> None:
win_inet = package.extras["socks"][0]
assert win_inet.name == "win-inet-pton"
assert win_inet.python_versions == "~2.7 || ~2.6"
assert (
str(win_inet.marker)
== 'sys_platform == "win32" and (python_version == "2.7"'
' or python_version == "2.6") and extra == "socks"'

# Different versions of poetry-core simplify the following marker differently,
# either is fine.
marker1 = (
'sys_platform == "win32" and (python_version == "2.7" or python_version =='
' "2.6") and extra == "socks"'
)
marker2 = (
'sys_platform == "win32" and python_version == "2.7" and extra == "socks" or'
' sys_platform == "win32" and python_version == "2.6" and extra == "socks"'
)
assert str(win_inet.marker) in {marker1, marker2}


@pytest.mark.parametrize(
Expand Down

0 comments on commit f8e24fc

Please sign in to comment.