Skip to content
Closed
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
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ Harald Armin Massa
Harshna
Henk-Jaap Wagenaar
Henry Schreiner
Himanshu
Holger Kohr
Hugo van Kemenade
Hui Wang (coldnight)
Expand Down
1 change: 1 addition & 0 deletions changelog/15219.misc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added regression tests for invalid regular expression patterns in RaisesExc and RaisesGroup.
8 changes: 8 additions & 0 deletions testing/python/raises_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -1368,3 +1368,11 @@ def test_expected_matching_only_on_matching() -> None:
RaisesGroup(TypeError, ValueError, TypeError),
):
raise ExceptionGroup("", [TypeError()])


def test_invalid_match_pattern() -> None:
with pytest.raises(Failed, match="Invalid regex pattern provided to 'match'"):
RaisesExc(ValueError, match="[")

with pytest.raises(Failed, match="Invalid regex pattern provided to 'match'"):
RaisesGroup(ValueError, match="[")