MCPcopy Index your code
hub / github.com/pytest-dev/pytest / check_raisesgroup_overloads

Function check_raisesgroup_overloads

testing/typing_raises_group.py:202–227  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

200
201
202def check_raisesgroup_overloads() -> None:
203 # allow_unwrapped=True does not allow:
204 # multiple exceptions
205 RaisesGroup(ValueError, TypeError, allow_unwrapped=True) # type: ignore
206 # nested RaisesGroup
207 RaisesGroup(RaisesGroup(ValueError), allow_unwrapped=True) # type: ignore
208 # specifying match
209 RaisesGroup(ValueError, match="foo", allow_unwrapped=True) # type: ignore
210 # specifying check
211 RaisesGroup(ValueError, check=bool, allow_unwrapped=True) # type: ignore
212 # allowed variants
213 RaisesGroup(ValueError, allow_unwrapped=True)
214 RaisesGroup(ValueError, allow_unwrapped=True, flatten_subgroups=True)
215 RaisesGroup(RaisesExc(ValueError), allow_unwrapped=True)
216
217 # flatten_subgroups=True does not allow nested RaisesGroup
218 RaisesGroup(RaisesGroup(ValueError), flatten_subgroups=True) # type: ignore
219 # but rest is plenty fine
220 RaisesGroup(ValueError, TypeError, flatten_subgroups=True)
221 RaisesGroup(ValueError, match="foo", flatten_subgroups=True)
222 RaisesGroup(ValueError, check=bool, flatten_subgroups=True)
223 RaisesGroup(ValueError, flatten_subgroups=True)
224 RaisesGroup(RaisesExc(ValueError), flatten_subgroups=True)
225
226 # if they're both false we can of course specify nested raisesgroup
227 RaisesGroup(RaisesGroup(ValueError))
228
229
230def check_triple_nested_raisesgroup() -> None:

Callers

nothing calls this directly

Calls 2

RaisesGroupClass · 0.90
RaisesExcClass · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…