-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed
Closed
ExceptionGroup ergonomics in pytest.param(..., marks=xfail(raises=...))#12504Description
Suppose you have a parameterized test, some params of which are expected to raise (e.g.) IndexError:
return pytest.param(
...,
marks=pytest.mark.xfail(raises=IndexError, strict=True),
)
...,
marks=pytest.mark.xfail(raises=IndexError, strict=True),
)
If your test is async though, you'll actually raise an ExceptionGroup(..., [IndexError]) (maybe with even more nesting), so the tests will still fail. Can we make this more ergonomic? What would a parametrize-aware RaisesGroup-like thing look like?