1414
1515load (":interpreter_tests.bzl" , "PYTHON_VERSIONS_TO_TEST" , "py_reconfig_interpreter_tests" )
1616
17+ # For this test the interpreter is sourced from the current configuration. That
18+ # means both the interpreter and the test itself are expected to run under the
19+ # same Python version.
1720py_reconfig_interpreter_tests (
1821 name = "interpreter_version_test" ,
1922 srcs = ["interpreter_test.py" ],
@@ -23,26 +26,26 @@ py_reconfig_interpreter_tests(
2326 env = {
2427 "PYTHON_BIN" : "$(rootpath //python/bin:python)" ,
2528 },
26- # Both the interpreter and the test itself are expected to run under
27- # the same version.
28- expected_interpreter_version = None ,
2929 main = "interpreter_test.py" ,
3030 python_versions = PYTHON_VERSIONS_TO_TEST ,
3131)
3232
33+ # For this test the interpreter is sourced from a binary pinned at a specific
34+ # Python version. That means the interpreter and the test itself can run
35+ # different Python versions.
3336py_reconfig_interpreter_tests (
3437 name = "python_src_test" ,
3538 srcs = ["interpreter_test.py" ],
3639 data = [
3740 "//python/bin:python" ,
3841 ],
3942 env = {
43+ # Since we're grabbing the interpreter from a binary with a fixed
44+ # version, we expect to always see that version. It doesn't matter what
45+ # Python version the test itself is running with.
46+ "EXPECTED_INTERPRETER_VERSION" : "3.11" ,
4047 "PYTHON_BIN" : "$(rootpath //python/bin:python)" ,
4148 },
42- # Since we're grabbing the interpreter from a binary with a fixed
43- # version, we expect to always see that version. It doesn't matter what
44- # Python version the test itself is running with.
45- expected_interpreter_version = "3.11" ,
4649 main = "interpreter_test.py" ,
4750 python_src = "//tools/publish:twine" ,
4851 python_versions = PYTHON_VERSIONS_TO_TEST ,
0 commit comments