()
| 200 | |
| 201 | |
| 202 | def 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 | |
| 230 | def check_triple_nested_raisesgroup() -> None: |
nothing calls this directly
no test coverage detected
searching dependent graphs…