Add on_failure callback #756
Labels
Priority: High
Broken behavior in specific environments like in parallel mode or only on some operating systems
Size: Medium
Changes in the same file
Type: Enhancement
Milestone
Is your feature request related to a problem? Please describe.
Sometimes we want to react to test failures in a specific way, doing special cleanup, inspecting in an interactive shell, ... currently, we can only use
teardown
and check whether the test completed.Describe the solution you'd like
An
on_failure
callback function that gets called immediately, when the test is known to have failed. As a bonus this might allow for overriding the failure.Describe alternatives you've considered
Special "failure only" cleanup can be done in
teardown
but is a bit more cumbersome. Dropping into an interactive shell could be solved with a specialized flag.The text was updated successfully, but these errors were encountered: