1616load ("@pythons_hub//:versions.bzl" , "DEFAULT_PYTHON_VERSION" )
1717load ("@rules_testing//lib:analysis_test.bzl" , "analysis_test" )
1818load ("@rules_testing//lib:test_suite.bzl" , "test_suite" )
19- load ("@rules_testing//lib:util.bzl" , "TestingAspectInfo" , rt_util = "util" )
19+ load ("@rules_testing//lib:util.bzl" , rt_util = "util" )
2020load ("//python:py_binary.bzl" , "py_binary" )
2121load ("//python:py_info.bzl" , "PyInfo" )
2222load ("//python:py_test.bzl" , "py_test" )
2323load ("//python/private:reexports.bzl" , "BuiltinPyInfo" ) # buildifier: disable=bzl-visibility
24- load ("//python/private:util.bzl" , "IS_BAZEL_7_OR_HIGHER" ) # buildifier: disable=bzl-visibility
2524load ("//tests/support:support.bzl" , "CC_TOOLCHAIN" )
2625
2726# NOTE @aignas 2024-06-04: we are using here something that is registered in the MODULE.Bazel
@@ -105,21 +104,14 @@ def _test_py_binary_windows_build_python_zip_false(name):
105104 )
106105
107106def _test_py_binary_windows_build_python_zip_false_impl (env , target ):
108- default_outputs = env .expect .that_target (target ).default_outputs ()
109- if IS_BAZEL_7_OR_HIGHER :
110- # TODO: These outputs aren't correct. The outputs shouldn't
111- # have the "_" prefix on them (those are coming from the underlying
112- # wrapped binary).
113- env .expect .that_target (target ).default_outputs ().contains_exactly ([
114- "{package}/{test_name}_subject.exe" ,
115- "{package}/{test_name}_subject" ,
116- "{package}/{test_name}_subject.py" ,
117- ])
118- else :
119- inner_exe = target [TestingAspectInfo ].attrs .target [DefaultInfo ].files_to_run .executable
120- default_outputs .contains_at_least ([
121- inner_exe .short_path ,
122- ])
107+ # TODO: These outputs aren't correct. The outputs shouldn't
108+ # have the "_" prefix on them (those are coming from the underlying
109+ # wrapped binary).
110+ env .expect .that_target (target ).default_outputs ().contains_exactly ([
111+ "{package}/{test_name}_subject.exe" ,
112+ "{package}/{test_name}_subject" ,
113+ "{package}/{test_name}_subject.py" ,
114+ ])
123115
124116_tests .append (_test_py_binary_windows_build_python_zip_false )
125117
@@ -132,21 +124,15 @@ def _test_py_binary_windows_build_python_zip_true(name):
132124
133125def _test_py_binary_windows_build_python_zip_true_impl (env , target ):
134126 default_outputs = env .expect .that_target (target ).default_outputs ()
135- if IS_BAZEL_7_OR_HIGHER :
136- # TODO: These outputs aren't correct. The outputs shouldn't
137- # have the "_" prefix on them (those are coming from the underlying
138- # wrapped binary).
139- default_outputs .contains_exactly ([
140- "{package}/{test_name}_subject.exe" ,
141- "{package}/{test_name}_subject.py" ,
142- "{package}/{test_name}_subject.zip" ,
143- ])
144- else :
145- inner_exe = target [TestingAspectInfo ].attrs .target [DefaultInfo ].files_to_run .executable
146- default_outputs .contains_at_least ([
147- "{package}/{test_name}_subject.zip" ,
148- inner_exe .short_path ,
149- ])
127+
128+ # TODO: These outputs aren't correct. The outputs shouldn't
129+ # have the "_" prefix on them (those are coming from the underlying
130+ # wrapped binary).
131+ default_outputs .contains_exactly ([
132+ "{package}/{test_name}_subject.exe" ,
133+ "{package}/{test_name}_subject.py" ,
134+ "{package}/{test_name}_subject.zip" ,
135+ ])
150136
151137_tests .append (_test_py_binary_windows_build_python_zip_true )
152138
0 commit comments