Skip to content

Commit bfc37ad

Browse files
isidorejmasonleegregorrieglerblade290nitsanavni
committed
- r Adding lambda
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>
1 parent 831a126 commit bfc37ad

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

approvaltests/namer/inline_python_reporter.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,14 @@ def __init__(self, reporter, add_approval_line=False, previous_result=None):
2020

2121
def report(self, received_path: str, approved_path: str) -> bool:
2222
test_source_file = self.get_test_source_file()
23-
24-
if self.previous_result:
23+
def applesauce():
2524
approved_text = Path(approved_path).read_text()
2625
approved_text = approved_text.rsplit("\n", 1)[0]
2726
approved_text = approved_text.rsplit(PREVIOUS_RESULT_, 1)[-1]
2827
previous_result_stuff = lambda: "\n" + PREVIOUS_RESULT_ + approved_text
29-
self.semi_automatic_extra_line = DELETE_ME_TO_APPROVE_ + previous_result_stuff()
28+
return DELETE_ME_TO_APPROVE_ + previous_result_stuff()
29+
if self.previous_result:
30+
self.semi_automatic_extra_line = applesauce()
3031
received_path = self.create_received_file(received_path, test_source_file)
3132
return self.diffReporter.report(received_path, test_source_file)
3233

0 commit comments

Comments
 (0)