Skip to content

Commit 0f1a5f9

Browse files
committed
fix test
1 parent 254bf89 commit 0f1a5f9

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/_pytest/raises.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -958,7 +958,7 @@ def _parse_excgroup(
958958
return exc
959959
elif isinstance(exc, tuple):
960960
raise TypeError(
961-
f"expected exception must be {expected}, not {type(exc)!r}.\n"
961+
f"expected exception must be {expected}, not {type(exc).__name__!r}.\n"
962962
"RaisesGroup does not support tuples of exception types when expecting one of "
963963
"several possible exception types like RaisesExc.\n"
964964
"If you meant to expect a group with multiple exceptions, list them as separate arguments."

testing/python/raises_group.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1339,7 +1339,7 @@ def test_tuples() -> None:
13391339
with pytest.raises(
13401340
TypeError,
13411341
match=wrap_escape(
1342-
"expected exception must be a BaseException type, RaisesExc, or RaisesGroup, not <class 'tuple'>.\n"
1342+
"expected exception must be a BaseException type, RaisesExc, or RaisesGroup, not 'tuple'.\n"
13431343
"RaisesGroup does not support tuples of exception types when expecting one of "
13441344
"several possible exception types like RaisesExc.\n"
13451345
"If you meant to expect a group with multiple exceptions, list them as separate arguments."

testing/test_warning_types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def test():
4343

4444
@pytest.mark.filterwarnings("error")
4545
def test_warn_explicit_for_annotates_errors_with_location():
46-
with pytest.raises(Warning, match="(?m)test\n at .*python_api.py:\\d+"):
46+
with pytest.raises(Warning, match="(?m)test\n at .*raises.py:\\d+"):
4747
warning_types.warn_explicit_for(
4848
pytest.raises, # type: ignore[arg-type]
4949
warning_types.PytestWarning("test"),

0 commit comments

Comments
 (0)