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.
This commit is contained in:
Eric Huss 2018-12-13 11:55:38 -08:00
parent 5bb302352a
commit fa94e8aab4
1 changed files with 1 additions and 1 deletions

View File

@ -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");
}
}