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"]
)
| 449 | return self._item.stash[caplog_handler_key] |
| 450 | |
| 451 | def get_records( |
| 452 | self, when: Literal[class="st">"setup", class="st">"call", class="st">"teardown"] |
| 453 | ) -> list[logging.LogRecord]: |
| 454 | class="st">"""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: class="st">"setup", class="st">"call" and class="st">"teardown". |
| 459 | |
| 460 | :returns: The list of captured records at the given stage. |
| 461 | |
| 462 | .. versionadded:: 3.4 |
| 463 | class="st">""" |
| 464 | return self._item.stash[caplog_records_key].get(when, []) |
| 465 | |
| 466 | @property |
| 467 | def text(self) -> str: |