From 96a13690f8552386bb183ebc01418774047ebbfc Mon Sep 17 00:00:00 2001 From: HampusM Date: Tue, 21 Mar 2023 22:29:42 +0100 Subject: fix: prevent panicking while panicking in expectation drop --- macros/src/expectation.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'macros') diff --git a/macros/src/expectation.rs b/macros/src/expectation.rs index 4095278..af604ae 100644 --- a/macros/src/expectation.rs +++ b/macros/src/expectation.rs @@ -427,7 +427,7 @@ impl ToTokens for Expectation if let ::ridicule::__private::CallCountExpectation::Times( times ) = self.call_cnt_expectation { - if call_cnt != times { + if !::std::thread::panicking() && call_cnt != times { panic!( concat!( "Expected function {} to be called {} times. Was ", -- cgit v1.2.3-18-g5258