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

Method test_warning_tuple

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

Source from the content-addressed store, hash-verified

238 )
239
240 def test_warning_tuple(self) -> None:
241 pytest.warns(
242 (RuntimeWarning, SyntaxWarning), lambda: warnings.warn("w1", RuntimeWarning)
243 )
244 pytest.warns(
245 (RuntimeWarning, SyntaxWarning), lambda: warnings.warn("w2", SyntaxWarning)
246 )
247 pytest.raises(
248 pytest.fail.Exception,
249 lambda: pytest.warns(
250 (RuntimeWarning, SyntaxWarning),
251 lambda: warnings.warn("w3", UserWarning),
252 ),
253 )
254
255 def test_as_contextmanager(self) -> None:
256 with pytest.warns(RuntimeWarning):

Callers

nothing calls this directly

Calls 1

warnMethod · 0.45

Tested by

no test coverage detected