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

Method get_records

src/_pytest/logging.py:451–464  ·  view source on GitHub ↗

Get the logging records for one of the possible test phases. :param 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. .. versionadded:: 3.4

(
        self, when: Literal["setup", "call", "teardown"]
    )

Source from the content-addressed store, hash-verified

449 return self._item.stash[caplog_handler_key]
450
451 def get_records(
452 self, when: Literal["setup", "call", "teardown"]
453 ) -> list[logging.LogRecord]:
454 """Get the logging records for one of the possible test phases.
455
456 :param when:
457 Which test phase to obtain the records from.
458 Valid values are: "setup", "call" and "teardown".
459
460 :returns: The list of captured records at the given stage.
461
462 .. versionadded:: 3.4
463 """
464 return self._item.stash[caplog_records_key].get(when, [])
465
466 @property
467 def text(self) -> str:

Calls 1

getMethod · 0.45

Tested by 3