From eb6a40b6ffb20ec20d29e80536ba2327befc0327 Mon Sep 17 00:00:00 2001 From: Emmanuel Ogbizi Date: Fri, 6 Mar 2020 11:51:55 -0500 Subject: [PATCH] refactor: reduce diff --- src/syrupy/extensions/base.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/syrupy/extensions/base.py b/src/syrupy/extensions/base.py index 9d1d54fe..1f45db85 100644 --- a/src/syrupy/extensions/base.py +++ b/src/syrupy/extensions/base.py @@ -330,11 +330,10 @@ def __format_line( line = line.replace(old, mute(new)) else: line = self.__strip_ends(line) - line = "".join( + return "".join( diff_style(char) if str(marker) in "-+^" else line_style(char) for marker, char in zip_longest(diff_markers.rstrip(), line) ) - return line_style(line) def __limit_context(self, lines: List[str]) -> Iterator[str]: yield from lines[: self._context_line_count]