Skip to content

Commit

Permalink
- F consolidate on success
Browse files Browse the repository at this point in the history
Co-Authored-By: jmasonlee <262853+jmasonlee@users.noreply.github.com>
Co-Authored-By: Gregor Riegler <rieglerg85@gmail.com>
Co-Authored-By: blade290 <43077216+blade290@users.noreply.github.com>
Co-Authored-By: Nitsan Avni <nitsanav@gmail.com>
Co-Authored-By: bhargavgundu <7643639+bhargavgundu@users.noreply.github.com>
  • Loading branch information
6 people committed May 19, 2024
1 parent e328bed commit 4adaf71
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions approvaltests/inline/inline_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,11 @@ def create_previous_capture_footer(received_path, approved_path):
approved_text = Path(approved_path).read_text()
approved_text = approved_text.rsplit("\n", 1)[0]
approved_text = approved_text.rsplit(PREVIOUS_RESULT_, 1)[-1]
previous_result_stuff = lambda: "\n" + PREVIOUS_RESULT_ + approved_text
return DELETE_ME_TO_APPROVE_ + previous_result_stuff()
received_text = Path(received_path).read_text().rsplit("\n", 1)[0]

if received_text != approved_text:
return DELETE_ME_TO_APPROVE_ + "\n" + PREVIOUS_RESULT_ + approved_text
return ""

class PreviousCaptureInlineOptions(InlineOptions):
def apply(self, options: "Options") -> "Options":
Expand Down

0 comments on commit 4adaf71

Please sign in to comment.