@@ -19,10 +19,11 @@ load("//python/private/pypi:pep508_evaluate.bzl", "evaluate", "tokenize") # bui
1919
2020_tests = []
2121
22- def _check_evaluate (env , expr , expected , values , strict = True ):
22+ def _check_evaluate (env , expr , expected , values , strict = True ):
2323 env .expect .where (
24- expression = expr , values = values
25- ).that_bool (evaluate (expr , env = values , strict = strict )).equals (expected )
24+ expression = expr ,
25+ values = values ,
26+ ).that_bool (evaluate (expr , env = values , strict = strict )).equals (expected )
2627
2728def _tokenize_tests (env ):
2829 for input , want in {
@@ -91,7 +92,7 @@ def _evaluate_non_version_env_tests(env):
9192
9293 # Check that the non-strict eval gives us back the input when no
9394 # env is supplied.
94- _check_evaluate (env , input , input .replace ("'" , '"' ), {}, strict = False )
95+ _check_evaluate (env , input , input .replace ("'" , '"' ), {}, strict = False )
9596
9697_tests .append (_evaluate_non_version_env_tests )
9798
@@ -129,7 +130,7 @@ def _evaluate_version_env_tests(env):
129130
130131 # Check that the non-strict eval gives us back the input when no
131132 # env is supplied.
132- _check_evaluate (env , input , input .replace ("'" , '"' ), {}, strict = False )
133+ _check_evaluate (env , input , input .replace ("'" , '"' ), {}, strict = False )
133134
134135_tests .append (_evaluate_version_env_tests )
135136
@@ -147,7 +148,7 @@ def _evaluate_platform_version_is_special(env):
147148
148149 # Check that the non-strict eval gives us back the input when no
149150 # env is supplied.
150- _check_evaluate (env , input , input .replace ("'" , '"' ), {}, strict = False )
151+ _check_evaluate (env , input , input .replace ("'" , '"' ), {}, strict = False )
151152
152153_tests .append (_evaluate_platform_version_is_special )
153154
@@ -207,7 +208,7 @@ def _logical_expression_tests(env):
207208
208209 # Check that the non-strict eval gives us back the input when no env
209210 # is supplied.
210- _check_evaluate (env , input , input .replace ("'" , '"' ), {}, strict = False )
211+ _check_evaluate (env , input , input .replace ("'" , '"' ), {}, strict = False )
211212
212213_tests .append (_logical_expression_tests )
213214
@@ -236,7 +237,7 @@ def _evaluate_partial_only_extra(env):
236237 strict = False ,
237238 )
238239 env .expect .that_bool (got ).equals (want )
239- _check_evaluate (env , input , want , env = {"extra" : extra }, strict = False )
240+ _check_evaluate (env , input , want , env = {"extra" : extra }, strict = False )
240241
241242_tests .append (_evaluate_partial_only_extra )
242243
@@ -266,9 +267,10 @@ def _evaluate_with_aliases(env):
266267_tests .append (_evaluate_with_aliases )
267268
268269def _expr_case (expr , want , env ):
269- return struct (expr = expr , want = want , env = env )
270+ return struct (expr = expr . strip () , want = want , env = env )
270271
271272_MISC_EXPRESSIONS = [
273+ _expr_case ('python_version == "3.*"' , True , {"python_version" : "3.10.1" }),
272274]
273275
274276def _misc_expressions (env ):
0 commit comments