Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/_pytest/raises.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ def _parse_exc(
return cast(type[BaseExcT_1], origin_exc)
else:
raise ValueError(
f"Only `ExceptionGroup[Exception]` or `BaseExceptionGroup[BaseExeption]` "
f"Only `ExceptionGroup[Exception]` or `BaseExceptionGroup[BaseException]` "
f"are accepted as generic types but got `{exc}`. "
f"As `raises` will catch all instances of the specified group regardless of the "
f"generic argument specific nested exceptions has to be checked "
Expand Down
2 changes: 1 addition & 1 deletion testing/python/raises_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -1304,7 +1304,7 @@ def test_parametrizing_conditional_raisesgroup(
def test_annotated_group() -> None:
# repr depends on if exceptiongroup backport is being used or not
t = repr(ExceptionGroup[ValueError])
msg = "Only `ExceptionGroup[Exception]` or `BaseExceptionGroup[BaseExeption]` are accepted as generic types but got `{}`. As `raises` will catch all instances of the specified group regardless of the generic argument specific nested exceptions has to be checked with `RaisesGroup`."
msg = "Only `ExceptionGroup[Exception]` or `BaseExceptionGroup[BaseException]` are accepted as generic types but got `{}`. As `raises` will catch all instances of the specified group regardless of the generic argument specific nested exceptions has to be checked with `RaisesGroup`."

fail_msg = wrap_escape(msg.format(t))
with pytest.raises(ValueError, match=fail_msg):
Expand Down
Loading