@@ -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]
@@ -1079,7 +1078,7 @@ def test_raisesexc() -> None:
10791078 with pytest .raises (
10801079 ValueError ,
10811080 match = wrap_escape (
1082- "expected exception must be a BaseException type, not 'object'"
1081+ "Expected a BaseException type, but got 'object'"
10831082 ),
10841083 ):
10851084 RaisesExc (object ) # type: ignore[type-var]
@@ -1351,7 +1350,7 @@ def test_tuples() -> None:
13511350 with pytest .raises (
13521351 TypeError ,
13531352 match = wrap_escape (
1354- "expected exception must be a BaseException type, RaisesExc, or RaisesGroup, not 'tuple'.\n "
1353+ "Expected a BaseException type, RaisesExc, or RaisesGroup, but got 'tuple'.\n "
13551354 "RaisesGroup does not support tuples of exception types when expecting one of "
13561355 "several possible exception types like RaisesExc.\n "
13571356 "If you meant to expect a group with multiple exceptions, list them as separate arguments."
0 commit comments