From 113bfb6be88523df3983c358fbed5bb75f234b0c Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Mon, 22 Jan 2018 21:43:35 -0200 Subject: [PATCH] Report 'call' phase as 'live log call' As commented in review, this makes it consistent with the headers shown by stdout/stderr capturing ("Captured log call") --- _pytest/logging.py | 3 +-- testing/logging/test_reporting.py | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/_pytest/logging.py b/_pytest/logging.py index 46d447326..44db8ea90 100644 --- a/_pytest/logging.py +++ b/_pytest/logging.py @@ -409,8 +409,7 @@ class _LiveLoggingStreamHandler(logging.StreamHandler): self.stream.write('\n') self._first_record_emitted = True if not self._section_name_shown: - header = 'live log' if self._when == 'call' else 'live log ' + self._when - self.stream.section(header, sep='-', bold=True) + self.stream.section('live log ' + self._when, sep='-', bold=True) self._section_name_shown = True logging.StreamHandler.emit(self, record) finally: diff --git a/testing/logging/test_reporting.py b/testing/logging/test_reporting.py index 5e8cd33e5..f5272aa09 100644 --- a/testing/logging/test_reporting.py +++ b/testing/logging/test_reporting.py @@ -254,7 +254,7 @@ def test_log_cli_default_level_sections(testdir, request): '{}::test_log_1 '.format(filename), '*-- live log setup --*', '*WARNING*log message from setup of test_log_1*', - '*-- live log --*', + '*-- live log call --*', '*WARNING*log message from test_log_1*', 'PASSED *50%*', '*-- live log teardown --*', @@ -263,7 +263,7 @@ def test_log_cli_default_level_sections(testdir, request): '{}::test_log_2 '.format(filename), '*-- live log setup --*', '*WARNING*log message from setup of test_log_2*', - '*-- live log --*', + '*-- live log call --*', '*WARNING*log message from test_log_2*', 'PASSED *100%*', '*-- live log teardown --*',