Skip to content

Commit fa94e8a

Browse files
committed
Fix panic-in-panic in tests.
There are some very rare circumstances that can cause a double panic during development. For example, `.with_json("")` will panic, and then the drop will also panic.
1 parent 5bb3023 commit fa94e8a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/testsuite/support/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1162,7 +1162,7 @@ impl Execs {
11621162

11631163
impl Drop for Execs {
11641164
fn drop(&mut self) {
1165-
if !self.ran {
1165+
if !self.ran && !std::thread::panicking() {
11661166
panic!("forgot to run this command");
11671167
}
11681168
}

0 commit comments

Comments
 (0)