From 11255fbc2e19c30f2b648e057122fbbd9a2cf45b Mon Sep 17 00:00:00 2001 From: vyuroshchin Date: Thu, 28 Aug 2025 02:28:51 +0300 Subject: [PATCH] fix: change Exeption to Exception in raises.py --- src/_pytest/raises.py | 2 +- testing/python/raises_group.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/_pytest/raises.py b/src/_pytest/raises.py index 5a82f58e656..78fae6ddcde 100644 --- a/src/_pytest/raises.py +++ b/src/_pytest/raises.py @@ -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 " diff --git a/testing/python/raises_group.py b/testing/python/raises_group.py index 04979c32e98..386e127a13d 100644 --- a/testing/python/raises_group.py +++ b/testing/python/raises_group.py @@ -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):