Skip to content

Commit

Permalink
. d updated markdown snippets
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed May 19, 2024
1 parent 4adaf71 commit 3c4c7e4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions approvaltests/inline/inline_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def apply(self, options: "Options") -> "Options":
return options.with_reporter(
InlinePythonReporter(
ReporterThatAutomaticallyApproves(),
create_footer_function=lambda __,___: DELETE_ME_TO_APPROVE_,
create_footer_function=lambda __, ___: DELETE_ME_TO_APPROVE_,
)
)

Expand All @@ -46,7 +46,7 @@ def create_previous_capture_footer(received_path, approved_path):
approved_text = approved_text.rsplit("\n", 1)[0]
approved_text = approved_text.rsplit(PREVIOUS_RESULT_, 1)[-1]
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 ""
Expand Down
6 changes: 4 additions & 2 deletions approvaltests/namer/inline_python_reporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@

class InlinePythonReporter(Reporter):
def __init__(
self, reporter: Reporter, create_footer_function: Callable[[str, str], str] = None
self,
reporter: Reporter,
create_footer_function: Callable[[str, str], str] = None,
):
self.diffReporter = reporter
self.footer_function = create_footer_function or (lambda __,___: "")
self.footer_function = create_footer_function or (lambda __, ___: "")
self.footer = ""

def report(self, received_path: str, approved_path: str) -> bool:
Expand Down

0 comments on commit 3c4c7e4

Please sign in to comment.