@@ -693,7 +693,7 @@ impl<T: Shell + Clone> Activator<T> {
693693mod tests {
694694 use std:: { collections:: BTreeMap , str:: FromStr } ;
695695
696- use tempdir :: TempDir ;
696+ use tempfile :: TempDir ;
697697
698698 use super :: * ;
699699 #[ cfg( unix) ]
@@ -703,7 +703,7 @@ mod tests {
703703 #[ test]
704704 #[ cfg( unix) ]
705705 fn test_post_activation_env_vars_applied_after_scripts_bash ( ) {
706- let temp_dir = TempDir :: new ( "test_post_activation_env_vars" ) . unwrap ( ) ;
706+ let temp_dir = TempDir :: with_prefix ( "test_post_activation_env_vars" ) . unwrap ( ) ;
707707
708708 // Create a dummy activation script so the activator will run it
709709 let activate_dir = temp_dir. path ( ) . join ( "etc/conda/activate.d" ) ;
@@ -772,7 +772,7 @@ mod tests {
772772
773773 #[ test]
774774 fn test_collect_scripts ( ) {
775- let tdir = TempDir :: new ( "test" ) . unwrap ( ) ;
775+ let tdir = TempDir :: with_prefix ( "test" ) . unwrap ( ) ;
776776
777777 let path = tdir. path ( ) . join ( "etc/conda/activate.d/" ) ;
778778 fs:: create_dir_all ( & path) . unwrap ( ) ;
@@ -802,7 +802,7 @@ mod tests {
802802
803803 #[ test]
804804 fn test_collect_env_vars ( ) {
805- let tdir = TempDir :: new ( "test" ) . unwrap ( ) ;
805+ let tdir = TempDir :: with_prefix ( "test" ) . unwrap ( ) ;
806806 let path = tdir. path ( ) . join ( "conda-meta/state" ) ;
807807 fs:: create_dir_all ( path. parent ( ) . unwrap ( ) ) . unwrap ( ) ;
808808
@@ -819,7 +819,7 @@ mod tests {
819819
820820 #[ test]
821821 fn test_collect_env_vars_with_directory ( ) {
822- let tdir = TempDir :: new ( "test" ) . unwrap ( ) ;
822+ let tdir = TempDir :: with_prefix ( "test" ) . unwrap ( ) ;
823823 let state_path = tdir. path ( ) . join ( "conda-meta/state" ) ;
824824 fs:: create_dir_all ( state_path. parent ( ) . unwrap ( ) ) . unwrap ( ) ;
825825
@@ -869,7 +869,7 @@ mod tests {
869869
870870 #[ cfg( unix) ]
871871 fn create_temp_dir ( ) -> TempDir {
872- let tempdir = TempDir :: new ( "test" ) . unwrap ( ) ;
872+ let tempdir = TempDir :: with_prefix ( "test" ) . unwrap ( ) ;
873873 let path = tempdir. path ( ) . join ( "etc/conda/activate.d/" ) ;
874874 fs:: create_dir_all ( & path) . unwrap ( ) ;
875875
@@ -1091,7 +1091,7 @@ mod tests {
10911091
10921092 #[ test]
10931093 fn test_deactivation ( ) {
1094- let tmp_dir = TempDir :: new ( "test_deactivation" ) . unwrap ( ) ;
1094+ let tmp_dir = TempDir :: with_prefix ( "test_deactivation" ) . unwrap ( ) ;
10951095 let tmp_dir_path = tmp_dir. path ( ) ;
10961096
10971097 // Create an activator with some test environment variables
@@ -1148,7 +1148,7 @@ mod tests {
11481148
11491149 #[ test]
11501150 fn test_deactivation_when_activated ( ) {
1151- let tmp_dir = TempDir :: new ( "test_deactivation" ) . unwrap ( ) ;
1151+ let tmp_dir = TempDir :: with_prefix ( "test_deactivation" ) . unwrap ( ) ;
11521152 let tmp_dir_path = tmp_dir. path ( ) ;
11531153
11541154 // Create an activator with some test environment variables
@@ -1214,7 +1214,7 @@ mod tests {
12141214
12151215 #[ test]
12161216 fn test_nested_deactivation ( ) {
1217- let tmp_dir = TempDir :: new ( "test_deactivation" ) . unwrap ( ) ;
1217+ let tmp_dir = TempDir :: with_prefix ( "test_deactivation" ) . unwrap ( ) ;
12181218 let tmp_dir_path = tmp_dir. path ( ) ;
12191219
12201220 // Create an activator with some test environment variables
@@ -1333,7 +1333,7 @@ mod tests {
13331333
13341334 #[ test]
13351335 fn test_resetting_conda_shlvl ( ) {
1336- let tmp_dir = TempDir :: new ( "test_deactivation" ) . unwrap ( ) ;
1336+ let tmp_dir = TempDir :: with_prefix ( "test_deactivation" ) . unwrap ( ) ;
13371337 let tmp_dir_path = tmp_dir. path ( ) ;
13381338
13391339 // Create an activator with some test environment variables
0 commit comments