diff options
author | Anders Hovmöller <anders.hovmoller@trioptima.com> | 2018-01-15 15:01:01 +0100 |
---|---|---|
committer | Anders Hovmöller <anders.hovmoller@trioptima.com> | 2018-01-19 12:42:35 +0100 |
commit | 7ea5a22657027d87e7b35f456e9b044a097c910e (patch) | |
tree | 4ea9e1b85a252c943605369a34de49aaa9c56a7b /doc/en/logging.rst | |
parent | 01e37fe892d2f77ee767d8e22dfd5201a3fbefc5 (diff) | |
download | pytest-7ea5a22657027d87e7b35f456e9b044a097c910e.tar.gz |
Access captures logs in teardown
Diffstat (limited to 'doc/en/logging.rst')
-rw-r--r-- | doc/en/logging.rst | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/doc/en/logging.rst b/doc/en/logging.rst index e3bf56038..9a6df8484 100644 --- a/doc/en/logging.rst +++ b/doc/en/logging.rst @@ -190,3 +190,12 @@ option names are: * ``log_file_level`` * ``log_file_format`` * ``log_file_date_format`` + +Accessing logs from other test stages +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The ``caplop.records`` fixture contains records from the current stage only. So +inside the setup phase it contains only setup logs, same with the call and +teardown phases. To access logs from other stages you can use +``caplog.get_handler('setup').records``. Valid stages are ``setup``, ``call`` +and ``teardown``. |