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 5a548ca commit eb6a40b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/syrupy/extensions/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit eb6a40b

Please sign in to comment.