Skip to content

Commit 59373fe

Browse files
authored
Merge pull request #9271 from thisch/unpack
Inline PercentStyleMultiline._update_message
2 parents 86446ed + d8b6479 commit 59373fe

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

src/_pytest/logging.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -118,14 +118,6 @@ def __init__(self, fmt: str, auto_indent: Union[int, str, bool, None]) -> None:
118118
super().__init__(fmt)
119119
self._auto_indent = self._get_auto_indent(auto_indent)
120120

121-
@staticmethod
122-
def _update_message(
123-
record_dict: Dict[str, object], message: str
124-
) -> Dict[str, object]:
125-
tmp = record_dict.copy()
126-
tmp["message"] = message
127-
return tmp
128-
129121
@staticmethod
130122
def _get_auto_indent(auto_indent_option: Union[int, str, bool, None]) -> int:
131123
"""Determine the current auto indentation setting.
@@ -191,7 +183,7 @@ def format(self, record: logging.LogRecord) -> str:
191183

192184
if auto_indent:
193185
lines = record.message.splitlines()
194-
formatted = self._fmt % self._update_message(record.__dict__, lines[0])
186+
formatted = self._fmt % {**record.__dict__, "message": lines[0]}
195187

196188
if auto_indent < 0:
197189
indentation = _remove_ansi_escape_sequences(formatted).find(

0 commit comments

Comments
 (0)