MCPcopy
hub / github.com/pytest-dev/pytest / fails_raises_group

Function fails_raises_group

testing/python/raises_group.py:28–33  ·  view source on GitHub ↗
(msg: str, add_prefix: bool = True)

Source from the content-addressed store, hash-verified

26
27
28def fails_raises_group(msg: str, add_prefix: bool = True) -> RaisesExc[Failed]:
29 assert msg[-1] != "\n", (
30 "developer error, expected string should not end with newline"
31 )
32 prefix = "Raised exception group did not match: " if add_prefix else ""
33 return pytest.raises(Failed, match=wrap_escape(prefix + msg))
34
35
36def test_raises_group() -> None:

Callers 15

test_raises_groupFunction · 0.85
test_flatten_subgroupsFunction · 0.85
test_matchFunction · 0.85
test_checkFunction · 0.85
test_assert_messageFunction · 0.85
test_message_indentFunction · 0.85
test_misordering_exampleFunction · 0.85

Calls 1

wrap_escapeFunction · 0.70

Tested by 15

test_raises_groupFunction · 0.68
test_flatten_subgroupsFunction · 0.68
test_matchFunction · 0.68
test_checkFunction · 0.68
test_assert_messageFunction · 0.68
test_message_indentFunction · 0.68
test_misordering_exampleFunction · 0.68