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

Function recwarn

src/_pytest/recwarn.py:37–45  ·  view source on GitHub ↗

Return a :class:`WarningsRecorder` instance that records all warnings emitted by test functions. See :ref:`warnings` for information on warning categories.

()

Source from the content-addressed store, hash-verified

35
36@fixture
37def recwarn() -> Generator[WarningsRecorder]:
38 """Return a :class:`WarningsRecorder` instance that records all warnings emitted by test functions.
39
40 See :ref:`warnings` for information on warning categories.
41 """
42 wrec = WarningsRecorder(_ispytest=True)
43 with wrec:
44 warnings.simplefilter("default")
45 yield wrec
46
47
48@overload

Callers

nothing calls this directly

Calls 1

WarningsRecorderClass · 0.85

Tested by

no test coverage detected