Skip to content

Rule that suggests explicit strict= in @pytest.mark.xfail #267

@lengau

Description

@lengau

Rule request

Description

Detect use of the @pytest.mark.xfail decorator and ensure it explicitly sets a strict=True or strict=False rather than allowing silent (and possibly accidental) use of the default False configuration.

Rationale

The pytest.mark.xfail decorator has a strict parameter that defaults to False, making xfail in CI roughly equivalent to a skip rather than failing if the test passes. This would prevent accidentally committing xfail tests that get hidden in CI.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions