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

Method get_records

src/_pytest/logging.py:384–395  ·  view source on GitHub ↗

Get the logging records for one of the possible test phases. :param str when: Which test phase to obtain the records from. Valid values are: "setup", "call" and "teardown". :returns: The list of captured records at the given stage. :rtype: List[logging.LogRecord

(self, when: str)

Source from the content-addressed store, hash-verified

382 return self._item.stash[caplog_handler_key]
383
384 def get_records(self, when: str) -> List[logging.LogRecord]:
385 """Get the logging records for one of the possible test phases.
386
387 :param str when:
388 Which test phase to obtain the records from. Valid values are: "setup", "call" and "teardown".
389
390 :returns: The list of captured records at the given stage.
391 :rtype: List[logging.LogRecord]
392
393 .. versionadded:: 3.4
394 """
395 return self._item.stash[caplog_records_key].get(when, [])
396
397 @property
398 def text(self) -> str:

Calls 1

getMethod · 0.45