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

Function test_recwarn_functional

testing/test_recwarn.py:19–30  ·  view source on GitHub ↗
(pytester: Pytester)

Source from the content-addressed store, hash-verified

17
18
19def test_recwarn_functional(pytester: Pytester) -> None:
20 pytester.makepyfile(
21 """
22 import warnings
23 def test_method(recwarn):
24 warnings.warn("hello")
25 warn = recwarn.pop()
26 assert isinstance(warn.message, UserWarning)
27 """
28 )
29 reprec = pytester.inline_run()
30 reprec.assertoutcome(passed=1)
31
32
33@pytest.mark.filterwarnings("")

Callers

nothing calls this directly

Calls 3

assertoutcomeMethod · 0.80
makepyfileMethod · 0.45
inline_runMethod · 0.45

Tested by

no test coverage detected