Skip to content

Commit

Permalink
Fix panic-in-panic in tests.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ehuss committed Dec 13, 2018
1 parent 5bb3023 commit fa94e8a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/testsuite/support/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1162,7 +1162,7 @@ impl Execs {

impl Drop for Execs {
fn drop(&mut self) {
if !self.ran {
if !self.ran && !std::thread::panicking() {
panic!("forgot to run this command");
}
}
Expand Down

0 comments on commit fa94e8a

Please sign in to comment.