Skip to content

Commit

Permalink
refactor: reduce diff
Browse files Browse the repository at this point in the history
  • Loading branch information
Emmanuel Ogbizi committed Mar 6, 2020
1 parent eb6a40b commit e897763
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/syrupy/extensions/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ def __diff_data(self, a: str, b: str) -> Iterator["DiffedLine"]:
def __format_line(
self,
line: str,
diff_markers: str,
marker_line: str,
line_style: Callable[[str], str],
diff_style: Callable[[str], str],
show_ends: bool,
Expand All @@ -332,7 +332,7 @@ def __format_line(
line = self.__strip_ends(line)
return "".join(
diff_style(char) if str(marker) in "-+^" else line_style(char)
for marker, char in zip_longest(diff_markers.rstrip(), line)
for marker, char in zip_longest(marker_line.rstrip(), line)
)

def __limit_context(self, lines: List[str]) -> Iterator[str]:
Expand Down

0 comments on commit e897763

Please sign in to comment.