Skip to content

Extend ASYNC401 to other forms #475

Open

Description

@tjkuson

I was looking at implementing ASYNC401 in Ruff and noticed that there are a couple forms that the rule here doesn't capture but arguably should.

  • pytest.mark.xfail(raises=ExceptionGroup) could be pytest.mark.xfail(raises=pytest.RaisesGroup(...))
  • pytest.RaisesGroup(ExceptionGroup) could be pytest.RaisesGroup(pytest.RaisesGroup(...))
  • pytest.raises(ExceptionGroup[Exception]) and pytest.RaisesExc(ExceptionGroup) are ignored even though they are equivalent to pytest.raises(ExceptionGroup)

Would there be interest in updating the rule to report on the usages above as well?

Activity

  1. jakkdl commented on Sep 22, 2026

    @jakkdl
    Member

    Yeah, I think all these should be covered. I don't think there was any conscious decision from @paranoa233 in #466 to skip them.

    Feel free to flag them in Ruff straight away

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions