@@ -2895,7 +2895,7 @@ fn run_script_explicit_directory() -> Result<()> {
2895
2895
2896
2896
#[ test]
2897
2897
#[ cfg( windows) ]
2898
- fn run_gui_script_explicit ( ) -> Result < ( ) > {
2898
+ fn run_gui_script_explicit_windows ( ) -> Result < ( ) > {
2899
2899
let context = TestContext :: new ( "3.12" ) ;
2900
2900
2901
2901
let test_script = context. temp_dir . child ( "script" ) ;
@@ -2932,24 +2932,35 @@ fn run_gui_script_explicit() -> Result<()> {
2932
2932
2933
2933
#[ test]
2934
2934
#[ cfg( not( windows) ) ]
2935
- fn run_gui_script_not_supported ( ) -> Result < ( ) > {
2935
+ fn run_gui_script_explicit_unix ( ) -> Result < ( ) > {
2936
2936
let context = TestContext :: new ( "3.12" ) ;
2937
2937
let test_script = context. temp_dir . child ( "script" ) ;
2938
2938
test_script. write_str ( indoc ! { r#"
2939
2939
# /// script
2940
2940
# requires-python = ">=3.11"
2941
2941
# dependencies = []
2942
2942
# ///
2943
- print("Hello")
2943
+ import sys
2944
+ import os
2945
+
2946
+ executable = os.path.basename(sys.executable).lower()
2947
+ print(f"Using executable: {executable}", file=sys.stderr)
2944
2948
"# } ) ?;
2945
2949
2946
2950
uv_snapshot ! ( context. filters( ) , context. run( ) . arg( "--gui-script" ) . arg( "script" ) , @r###"
2947
2951
success: false
2948
- exit_code: 2
2952
+ exit_code: 1
2949
2953
----- stdout -----
2950
2954
2951
2955
----- stderr -----
2952
- error: `--gui-script` is only supported on Windows. Did you mean `--script`?
2956
+ Reading inline script metadata from `script`
2957
+ Resolved in [TIME]
2958
+ Audited in [TIME]
2959
+ Traceback (most recent call last):
2960
+ File "[TEMP_DIR]/script", line 8, in <module>
2961
+ print(f"Using executable: {executable}", file=sys.stderr)
2962
+ ^^^^^^^^^^
2963
+ NameError: name 'executable' is not defined
2953
2964
"### ) ;
2954
2965
2955
2966
Ok ( ( ) )
0 commit comments