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 Mar 17, 2024
1 parent a36f806 commit f084718
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion approvaltests/namer/inline_python_reporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def get_test_source_file(self):
test_stack_frame: FrameInfo = StackFrameNamer.get_test_frame()
return test_stack_frame.filename

def create_received_file(self, received_path: str, test_source_file: str ):
def create_received_file(self, received_path: str, test_source_file: str):
code = Path(test_source_file).read_text()
received_text = Path(received_path).read_text()[:-1]
method_name = StackFrameNamer.get_test_frame().function
Expand Down
3 changes: 2 additions & 1 deletion approvaltests/reporters/report_quietly.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ class ReportQuietly(Reporter):
def report(self, received_path: str, approved_path: str) -> bool:
return True

QuietReport = ReportQuietly # backwards compatibility

QuietReport = ReportQuietly # backwards compatibility
9 changes: 7 additions & 2 deletions tests/test_inline_approvals.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
Reporter,
verify,
verify_all,
verify_all_combinations_with_labeled_input, ApprovalException,
verify_all_combinations_with_labeled_input,
ApprovalException,
)
from approvaltests.inline.parse_docstring import parse_docstring
from approvaltests.reporters import MultiReporter, ReportWithBeyondCompare
Expand Down Expand Up @@ -124,20 +125,24 @@ def test_uppercase():
options=Options().inline(),
)


options = Options().inline()


def test_when_options_is_created_outside_of_test():
"""
hello
world
"""
verify(greeting(), options=options)


def test_exception_on_failure():
"""
this string should not match
"""
with pytest.raises(ApprovalException):
verify(greeting(), options=Options().with_reporter(ReportQuietly()).inline())
verify(greeting(), options=Options().with_reporter(ReportQuietly()).inline())


class InlineTests(unittest.TestCase):
Expand Down

0 comments on commit f084718

Please sign in to comment.