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

Method test_warn_stacklevel

testing/test_recwarn.py:103–107  ·  testing/test_recwarn.py::TestWarningsRecorderChecker.test_warn_stacklevel

#4243

(self)

Source from the content-addressed store, hash-verified

101 rec.pop()
102
103 def test_warn_stacklevel(self) -> None:
104 class="st">""class="st">"class="cm">#4243"class="st">""
105 rec = WarningsRecorder(_ispytest=True)
106 with rec:
107 warnings.warn(class="st">"test", DeprecationWarning, 2)
108
109 def test_typechecking(self) -> None:
110 from _pytest.recwarn import WarningsChecker

Callers

nothing calls this directly

Calls 2

WarningsRecorderClass · 0.90
warnMethod · 0.45

Tested by

no test coverage detected