File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -331,11 +331,22 @@ mod tests {
331331
332332 // Provide an invalid explicit path (points to a non-existent directory)
333333 let invalid_path = project_dir. path ( ) . join ( "non_existent_venv" ) ;
334+ let invalid_path_str = invalid_path. to_str ( ) . unwrap ( ) ;
334335 // Ensure the invalid path doesn't accidentally exist
335- assert ! ( !invalid_path. exists( ) , "Invalid path should not exist" ) ;
336+ assert ! ( !invalid_path. exists( ) , "Invalid path '{}' should not exist before test" , invalid_path . display ( ) ) ;
336337
337- let env = PythonEnvironment :: new ( project_dir. path ( ) , Some ( invalid_path. to_str ( ) . unwrap ( ) ) )
338- . expect ( "Should fall through to VIRTUAL_ENV" ) ;
338+ // --- Add a small delay before calling the function under test ---
339+ eprintln ! ( "--- Adding small delay before PythonEnvironment::new call ---" ) ;
340+ std:: thread:: sleep ( std:: time:: Duration :: from_millis ( 50 ) ) ; // 50ms delay
341+ eprintln ! ( "--- Delay finished. Starting PythonEnvironment::new call for the test ---" ) ;
342+ // --- End added delay ---
343+
344+ eprintln ! ( "--- Starting PythonEnvironment::new call for the test ---" ) ;
345+ // Call the function under test
346+ let env_result = PythonEnvironment :: new ( project_dir. path ( ) , Some ( invalid_path_str) ) ;
347+ eprintln ! ( "--- Finished PythonEnvironment::new call for the test ---" ) ;
348+
349+ let env = env_result. expect ( "Should fall through to VIRTUAL_ENV" ) ;
339350
340351 // Should have found the one from VIRTUAL_ENV
341352 assert_eq ! (
You can’t perform that action at this time.
0 commit comments