Skip to content

Add on_failure callback #756

@martin-schulze-vireso

Description

@martin-schulze-vireso

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Priority: HighBroken behavior in specific environments like in parallel mode or only on some operating systemsSize: MediumChanges in the same fileType: Enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions