@@ -36,19 +36,18 @@ def fails_raises_group(msg: str, add_prefix: bool = True) -> RaisesExc[Failed]:
3636def test_raises_group () -> None :
3737 with pytest .raises (
3838 TypeError ,
39- match = wrap_escape ("expected exception must be a BaseException type, not 'int'" ),
39+ match = wrap_escape ("Expected a BaseException type, but got 'int'" ),
4040 ):
4141 RaisesExc (5 ) # type: ignore[call-overload]
4242 with pytest .raises (
4343 ValueError ,
44- match = wrap_escape ("expected exception must be a BaseException type, not 'int'" ),
44+ match = wrap_escape ("Expected a BaseException type, but got 'int'" ),
4545 ):
4646 RaisesExc (int ) # type: ignore[type-var]
4747 with pytest .raises (
4848 TypeError ,
49- # TODO: bad sentence structure
5049 match = wrap_escape (
51- "expected exception must be a BaseException type, RaisesExc, or RaisesGroup, not an exception instance ( ValueError) " ,
50+ "Expected a BaseException type, RaisesExc, or RaisesGroup, but got an exception instance: ValueError" ,
5251 ),
5352 ):
5453 RaisesGroup (ValueError ()) # type: ignore[call-overload]
@@ -1078,9 +1077,7 @@ def test_raisesexc() -> None:
10781077 RaisesExc () # type: ignore[call-overload]
10791078 with pytest .raises (
10801079 ValueError ,
1081- match = wrap_escape (
1082- "expected exception must be a BaseException type, not 'object'"
1083- ),
1080+ match = wrap_escape ("Expected a BaseException type, but got 'object'" ),
10841081 ):
10851082 RaisesExc (object ) # type: ignore[type-var]
10861083
@@ -1351,7 +1348,7 @@ def test_tuples() -> None:
13511348 with pytest .raises (
13521349 TypeError ,
13531350 match = wrap_escape (
1354- "expected exception must be a BaseException type, RaisesExc, or RaisesGroup, not 'tuple'.\n "
1351+ "Expected a BaseException type, RaisesExc, or RaisesGroup, but got 'tuple'.\n "
13551352 "RaisesGroup does not support tuples of exception types when expecting one of "
13561353 "several possible exception types like RaisesExc.\n "
13571354 "If you meant to expect a group with multiple exceptions, list them as separate arguments."
0 commit comments