diff --git a/src/_pytest/python_api.py b/src/_pytest/python_api.py index 464654050..72973e2cf 100644 --- a/src/_pytest/python_api.py +++ b/src/_pytest/python_api.py @@ -1166,7 +1166,6 @@ def raises( try: func(*args[1:], **kwargs) except expected_exception as e: # type: ignore[misc] # TypeError raised for any ExpectedExceptionGroup - return _pytest._code.ExceptionInfo.from_exception(e) fail(message) diff --git a/testing/python/expected_exception_group.py b/testing/python/expected_exception_group.py index a3d964123..5d74b7361 100644 --- a/testing/python/expected_exception_group.py +++ b/testing/python/expected_exception_group.py @@ -119,7 +119,6 @@ class TestExpectedExceptionGroup: assert eeg.matches(ExceptionGroup("", (ValueError(),))) def test_message(self) -> None: - try: with pytest.raises(ExpectedExceptionGroup(ValueError)): ...