@@ -354,8 +354,9 @@ async fn file_override_toolchain_err_handling() {
354354async fn plus_override_toolchain_err_handling ( ) {
355355 let cx = CliTestContext :: new ( Scenario :: SimpleV2 ) . await ;
356356 cx. config
357- . expect_err (
357+ . expect_err_env (
358358 & [ "rustc" , "+beta" ] ,
359+ & [ ( "RUSTUP_AUTO_INSTALL" , "0" ) ] ,
359360 for_host ! ( "toolchain 'beta-{0}' is not installed" ) ,
360361 )
361362 . await ;
@@ -776,8 +777,9 @@ async fn upgrade_v2_to_v1() {
776777async fn list_targets_no_toolchain ( ) {
777778 let cx = CliTestContext :: new ( Scenario :: SimpleV2 ) . await ;
778779 cx. config
779- . expect_err (
780+ . expect_err_env (
780781 & [ "rustup" , "target" , "list" , "--toolchain=nightly" ] ,
782+ & [ ( "RUSTUP_AUTO_INSTALL" , "0" ) ] ,
781783 for_host ! ( "toolchain 'nightly-{0}' is not installed" ) ,
782784 )
783785 . await ;
@@ -962,18 +964,20 @@ async fn remove_target_by_component_remove() {
962964async fn add_target_no_toolchain ( ) {
963965 let cx = CliTestContext :: new ( Scenario :: SimpleV2 ) . await ;
964966 cx. config
965- . expect_err (
967+ . expect_err_env (
966968 & [
967969 "rustup" ,
968970 "target" ,
969971 "add" ,
970972 CROSS_ARCH1 ,
971973 "--toolchain=nightly" ,
972974 ] ,
975+ & [ ( "RUSTUP_AUTO_INSTALL" , "0" ) ] ,
973976 for_host ! ( "toolchain 'nightly-{0}' is not installed" ) ,
974977 )
975978 . await ;
976979}
980+
977981#[ tokio:: test]
978982async fn add_target_bogus ( ) {
979983 let mut cx = CliTestContext :: new ( Scenario :: SimpleV2 ) . await ;
@@ -1120,14 +1124,15 @@ async fn remove_target_not_installed() {
11201124async fn remove_target_no_toolchain ( ) {
11211125 let cx = CliTestContext :: new ( Scenario :: SimpleV2 ) . await ;
11221126 cx. config
1123- . expect_err (
1127+ . expect_err_env (
11241128 & [
11251129 "rustup" ,
11261130 "target" ,
11271131 "remove" ,
11281132 CROSS_ARCH1 ,
11291133 "--toolchain=nightly" ,
11301134 ] ,
1135+ & [ ( "RUSTUP_AUTO_INSTALL" , "0" ) ] ,
11311136 for_host ! ( "toolchain 'nightly-{0}' is not installed" ) ,
11321137 )
11331138 . await ;
0 commit comments