diff --git a/approvaltests/namer/inline_python_reporter.py b/approvaltests/namer/inline_python_reporter.py index b46abfb..7548553 100644 --- a/approvaltests/namer/inline_python_reporter.py +++ b/approvaltests/namer/inline_python_reporter.py @@ -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 diff --git a/approvaltests/reporters/report_quietly.py b/approvaltests/reporters/report_quietly.py index cad7efd..09d1f15 100644 --- a/approvaltests/reporters/report_quietly.py +++ b/approvaltests/reporters/report_quietly.py @@ -5,4 +5,5 @@ class ReportQuietly(Reporter): def report(self, received_path: str, approved_path: str) -> bool: return True -QuietReport = ReportQuietly # backwards compatibility \ No newline at end of file + +QuietReport = ReportQuietly # backwards compatibility diff --git a/tests/test_inline_approvals.py b/tests/test_inline_approvals.py index 37936a6..4c4e7a8 100644 --- a/tests/test_inline_approvals.py +++ b/tests/test_inline_approvals.py @@ -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 @@ -124,7 +125,10 @@ def test_uppercase(): options=Options().inline(), ) + options = Options().inline() + + def test_when_options_is_created_outside_of_test(): """ hello @@ -132,12 +136,13 @@ def test_when_options_is_created_outside_of_test(): """ 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):