Skip to content

difficult to catch Failed("DID NOT RAISE ...) in @pytest.mark.xfail(..., raises=...) #8928

@graingert

Description

@graingert

What's the problem this feature will solve?

I'm currently trying to narrow an xfail: https://github.com/celery/celery/pull/6271/files#diff-ed1ef452735a964f7b23398a1833b2dcc22df133c2b06dca3ffba46fe842daf9R830

currently I need to use raises=_pytest.main.Failed

Describe the solution you'd like

I'd like with pytest.raises(...): to raise a public subclass of Failed or an AssertionError

I'm currently trying to narrow an xfail: https://github.com/celery/celery/pull/6271/files#diff-ed1ef452735a964f7b23398a1833b2dcc22df133c2b06dca3ffba46fe842daf9R830

Alternative Solutions

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: docsdocumentation improvement, missing or needing clarification

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions