Skip to content

Commit 4adaf71

Browse files
isidorejmasonleegregorrieglerblade290nitsanavni
committed
- F consolidate on success
Co-Authored-By: jmasonlee <[email protected]> Co-Authored-By: Gregor Riegler <[email protected]> Co-Authored-By: blade290 <[email protected]> Co-Authored-By: Nitsan Avni <[email protected]> Co-Authored-By: bhargavgundu <[email protected]>
1 parent e328bed commit 4adaf71

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

approvaltests/inline/inline_options.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,11 @@ def create_previous_capture_footer(received_path, approved_path):
4545
approved_text = Path(approved_path).read_text()
4646
approved_text = approved_text.rsplit("\n", 1)[0]
4747
approved_text = approved_text.rsplit(PREVIOUS_RESULT_, 1)[-1]
48-
previous_result_stuff = lambda: "\n" + PREVIOUS_RESULT_ + approved_text
49-
return DELETE_ME_TO_APPROVE_ + previous_result_stuff()
48+
received_text = Path(received_path).read_text().rsplit("\n", 1)[0]
49+
50+
if received_text != approved_text:
51+
return DELETE_ME_TO_APPROVE_ + "\n" + PREVIOUS_RESULT_ + approved_text
52+
return ""
5053

5154
class PreviousCaptureInlineOptions(InlineOptions):
5255
def apply(self, options: "Options") -> "Options":

0 commit comments

Comments
 (0)