asomers / mockall

A powerful mock object library for Rust
Apache License 2.0
1.5k stars 62 forks source link

Always drop static methods' Expectations during Drop #443

Closed asomers closed 1 year ago

asomers commented 1 year ago

Even if a panic is in-progress. Originally we didn't drop them during panic, for fear of double-panicing. But there is already protection from double-panic in Common::drop. Not clearing expectations during a panic can cause surprising failures in one test case after a different test case panics.

Fixes #442

asomers commented 1 year ago

@DGolubets does this fix your problem?

DGolubets commented 1 year ago

@asomers Yes, it does. Thanks a lot!