Skip to content

Commit 1b0bba4

Browse files
committed
fix test
1 parent 134f3a2 commit 1b0bba4

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/_pytest/raises.py

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

testing/python/raises_group.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1328,7 +1328,7 @@ def test_tuples() -> None:
13281328
with pytest.raises(
13291329
TypeError,
13301330
match=wrap_escape(
1331-
"expected exception must be a BaseException type, RaisesExc, or RaisesGroup, not <class 'tuple'>.\n"
1331+
"expected exception must be a BaseException type, RaisesExc, or RaisesGroup, not 'tuple'.\n"
13321332
"RaisesGroup does not support tuples of exception types when expecting one of "
13331333
"several possible exception types like RaisesExc.\n"
13341334
"If you meant to expect a group with multiple exceptions, list them as separate arguments."

testing/test_warning_types.py

+1-1
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)