Skip to content

Commit a93284b

Browse files
committed
Fix tests that trigger clap colourisation
In-process tests have a tty and clap doesn't honour our process() abstraction; fortunately it does consult TERM, which is good enough.
1 parent f0fba5c commit a93284b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tests/mock/clitools.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,10 @@ pub fn setup(s: Scenario, f: &dyn Fn(&mut Config)) {
9292
env::remove_var("RUSTUP_TOOLCHAIN");
9393
env::remove_var("SHELL");
9494
env::remove_var("ZDOTDIR");
95+
// clap does it's own terminal colour probing, and that isn't
96+
// trait-controllable, but it does honour the terminal. To avoid testing
97+
// claps code, lie about whatever terminal this process was started under.
98+
env::set_var("TERM", "dumb");
9599

96100
match env::var("RUSTUP_BACKTRACE") {
97101
Ok(val) => env::set_var("RUST_BACKTRACE", val),

0 commit comments

Comments
 (0)