MCPcopy Create free account
hub / github.com/pytest-dev/pytest / test_several_messages

Method test_several_messages

testing/test_recwarn.py:228–233  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

226 pytest.warns(RuntimeWarning, source) # type: ignore
227
228 def test_several_messages(self) -> None:
229 # different messages, b/c Python suppresses multiple identical warnings
230 pytest.warns(RuntimeWarning, lambda: warnings.warn("w1", RuntimeWarning))
231 with pytest.raises(pytest.fail.Exception):
232 pytest.warns(UserWarning, lambda: warnings.warn("w2", RuntimeWarning))
233 pytest.warns(RuntimeWarning, lambda: warnings.warn("w3", RuntimeWarning))
234
235 def test_function(self) -> None:
236 pytest.warns(

Callers

nothing calls this directly

Calls 1

warnMethod · 0.45

Tested by

no test coverage detected