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

Function test_raisesexc_tostring

testing/python/raises_group.py:1195–1205  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1193
1194
1195def test_raisesexc_tostring() -> None:
1196 assert str(RaisesExc(ValueError)) == "RaisesExc(ValueError)"
1197 assert str(RaisesExc(match="[a-z]")) == "RaisesExc(match='[a-z]')"
1198 pattern_no_flags = re.compile(r"noflag", 0)
1199 assert str(RaisesExc(match=pattern_no_flags)) == "RaisesExc(match='noflag')"
1200 pattern_flags = re.compile(r"noflag", re.IGNORECASE)
1201 assert str(RaisesExc(match=pattern_flags)) == f"RaisesExc(match={pattern_flags!r})"
1202 assert (
1203 str(RaisesExc(ValueError, match="re", check=bool))
1204 == f"RaisesExc(ValueError, match='re', check={bool!r})"
1205 )
1206
1207
1208def test_raisesgroup_tostring() -> None:

Callers

nothing calls this directly

Calls 2

RaisesExcClass · 0.90
compileMethod · 0.80

Tested by

no test coverage detected