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

Method test_record_only

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

Source from the content-addressed store, hash-verified

309 assert str(record[0].message) == "user"
310
311 def test_record_only(self) -> None:
312 with pytest.warns() as record:
313 warnings.warn("user", UserWarning)
314 warnings.warn("runtime", RuntimeWarning)
315
316 assert len(record) == 2
317 assert str(record[0].message) == "user"
318 assert str(record[1].message) == "runtime"
319
320 def test_record_only_none_deprecated_warn(self) -> None:
321 # This should become an error when WARNS_NONE_ARG is removed in Pytest 8.0

Callers

nothing calls this directly

Calls 1

warnMethod · 0.45

Tested by

no test coverage detected