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 --*',