How to use the approvaltests.reporters.testing_reporter.ReporterForTesting function in approvaltests

To help you get started, we’ve selected a few approvaltests examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github approvals / ApprovalTests.Python / tests / test_fileapprover.py View on Github external
def test_returns_error_when_files_are_different(self):
        namer = get_default_namer()
        writer = StringWriter("b")
        reporter = ReporterForTesting()
        approver = FileApprover()
        error = approver.verify(namer, writer, reporter)
        self.assertEqual("Approval Mismatch", error)
github approvals / ApprovalTests.Python / tests / test_fileapprover.py View on Github external
def test_compare_different_files(self):
        approver = FileApprover()
        reporter = ReporterForTesting()
        approver.verify_files("a.txt", "b.txt", reporter)
        self.assertTrue(reporter.called)
github approvals / ApprovalTests.Python / tests / test_combinations.py View on Github external
def setUp(self):
        self.reporter = ReporterForTesting()
        self.reporter = CommandLineReporter()
        self.func = lambda *args: sum(args) + 1
github approvals / ApprovalTests.Python / tests / test_asserts.py View on Github external
def test_assert_against_file_fails_with_reporter(self):
        reporter = ReporterForTesting()
        file_path = get_adjacent_file("manual_file.approved.txt")
        try:
            assert_against_file("This text is NOT in a file", file_path, reporter )
        except ApprovalException:
            pass
        self.assertTrue(reporter.called)
github approvals / ApprovalTests.Python / tests / test_fileapprover.py View on Github external
def test_full(self):
        namer = get_default_namer()
        writer = StringWriter("b")
        reporter = ReporterForTesting()
        approver = FileApprover()
        approver.verify(namer, writer, reporter)
        self.assertTrue(reporter.called)
github approvals / ApprovalTests.Python / tests / test_combinations.py View on Github external
def setUp(self):
        self.reporter = ReporterForTesting()
        self.func = lambda *args: sum(args) + 1
github approvals / ApprovalTests.Python / tests / test_verify.py View on Github external
def test_verify_fail(self):
        reporter = ReporterForTesting()
        try:
            verify("Hello World.", reporter)
            self.assertFalse(True, "expected exception")
        except ApprovalException as e:
            self.assertTrue("Approval Mismatch", e.value)