Skip to content

Commit f8e24fc

Browse files
dimblebyradoering
authored andcommitted
tests: make tests forward compatible with simplified marker simplification (#7136)
(cherry picked from commit 0c8e5b4)
1 parent 8921a60 commit f8e24fc

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

tests/repositories/test_pypi_repository.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,18 @@ def test_package() -> None:
139139
win_inet = package.extras["socks"][0]
140140
assert win_inet.name == "win-inet-pton"
141141
assert win_inet.python_versions == "~2.7 || ~2.6"
142-
assert (
143-
str(win_inet.marker)
144-
== 'sys_platform == "win32" and (python_version == "2.7"'
145-
' or python_version == "2.6") and extra == "socks"'
142+
143+
# Different versions of poetry-core simplify the following marker differently,
144+
# either is fine.
145+
marker1 = (
146+
'sys_platform == "win32" and (python_version == "2.7" or python_version =='
147+
' "2.6") and extra == "socks"'
148+
)
149+
marker2 = (
150+
'sys_platform == "win32" and python_version == "2.7" and extra == "socks" or'
151+
' sys_platform == "win32" and python_version == "2.6" and extra == "socks"'
146152
)
153+
assert str(win_inet.marker) in {marker1, marker2}
147154

148155

149156
@pytest.mark.parametrize(

0 commit comments

Comments
 (0)