Skip to content

Commit e328bed

Browse files
isidorejmasonleegregorrieglerblade290nitsanavni
committed
- r pass in both received and approved to 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 e9ca727 commit e328bed

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

approvaltests/inline/inline_options.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def apply(self, options: "Options") -> "Options":
3030
return options.with_reporter(
3131
InlinePythonReporter(
3232
ReporterThatAutomaticallyApproves(),
33-
create_footer_function=lambda __: DELETE_ME_TO_APPROVE_,
33+
create_footer_function=lambda __,___: DELETE_ME_TO_APPROVE_,
3434
)
3535
)
3636

@@ -41,7 +41,7 @@ def semi_automatic_with_previous_approved():
4141
from approvaltests.namer.inline_python_reporter import InlinePythonReporter
4242
from approvaltests.reporters import ReporterThatAutomaticallyApproves
4343

44-
def create_previous_capture_footer(approved_path):
44+
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]

approvaltests/namer/inline_python_reporter.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@
99

1010
class InlinePythonReporter(Reporter):
1111
def __init__(
12-
self, reporter: Reporter, create_footer_function: Callable[[str], str] = None
12+
self, reporter: Reporter, create_footer_function: Callable[[str, str], str] = None
1313
):
1414
self.diffReporter = reporter
15-
self.footer_function = create_footer_function or (lambda __: "")
15+
self.footer_function = create_footer_function or (lambda __,___: "")
1616
self.footer = ""
1717

1818
def report(self, received_path: str, approved_path: str) -> bool:
1919
test_source_file = self.get_test_source_file()
20-
self.footer = self.footer_function(approved_path)
20+
self.footer = self.footer_function(received_path, approved_path)
2121
received_path = self.create_received_file(received_path, test_source_file)
2222
return self.diffReporter.report(received_path, test_source_file)
2323

0 commit comments

Comments
 (0)