@@ -26,7 +26,7 @@ def test_has_at_most_one_pinned_dependency(
2626):
2727 # These are known to be platforms that are not valid / possible at this time.
2828 # due the the sheer variety, the default assumption is that a given combination
29- # is invalid (and thus skipped) , allowing us to specify valid cases more easily
29+ # is invalid, allowing us to specify valid cases more easily below
3030 valid = False
3131 match (platform_system , platform_machine ):
3232 case ["Linux" , "arm64" ]:
@@ -39,8 +39,6 @@ def test_has_at_most_one_pinned_dependency(
3939 valid = True
4040 case [("AIX" | "OS400" ), ("x86" | "x86_64" | "s390x" )]:
4141 valid = True
42- if not valid :
43- pytest .skip (f"{ platform_system } and { platform_machine } are mutually exclusive." )
4442
4543 # currently linux-{64, aarch64, ppc64le}, osx-64, win-64; no support for arm64 yet
4644 pypy_pairs = [
@@ -52,10 +50,11 @@ def test_has_at_most_one_pinned_dependency(
5250 ]
5351 if (platform_python_implementation == "PyPy"
5452 and (platform_system , platform_machine ) not in pypy_pairs ):
55- pytest . skip ( f"PyPy is not supported on { platform_system } / { platform_machine } ." )
53+ valid = False
5654
5755 if platform_system == "OS400" and python_version != "3.9" :
58- pytest .skip (f"IBMi only supported on Python { python_version } ." )
56+ # IBMi only supported on CPython 3.9, see gh-66
57+ valid = False
5958
6059 environment = {
6160 "python_version" : python_version ,
@@ -104,10 +103,17 @@ def test_has_at_most_one_pinned_dependency(
104103 case ["Windows" , "arm64" ]:
105104 expect_pin = True
106105
107- # we only expect a pin for released python versions
108- expect_pin = False if (python_version == "3.12" ) else expect_pin
109- # also check that cases with expect_pin==False should _not_ have a pin
110- log_msg = "Expected " + ("exactly one pin" if expect_pin else "no pins" )
111- assert (
112- len (filtered_requirements ) == int (expect_pin )
113- ), f"{ log_msg } .\n { pprint .pformat (environment )} "
106+ # for valid combinations, we test more strictly: expect exactly zero or one pins
107+ if valid :
108+ # we only expect a pin for released python versions
109+ expect_pin = False if (python_version == "3.12" ) else expect_pin
110+ log_msg = "Expected " + ("exactly one pin" if expect_pin else "no pins" )
111+ assert (
112+ len (filtered_requirements ) == int (expect_pin )
113+ ), f"{ log_msg } .\n { pprint .pformat (environment )} "
114+ else :
115+ # on invalid platform / interpreter combinations, test
116+ # that at least we do not produce more than one pin
117+ assert (
118+ len (filtered_requirements ) <= 1
119+ ), f"Expected no more than one pin.\n { pprint .pformat (environment )} "
0 commit comments