How to use the approvaltests.utils.get_adjacent_file 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 / approvaltests / reporters / generic_diff_reporter_factory.py View on Github external
def __init__(self):
        self.load(get_adjacent_file('reporters.json'))
        self.add_fallback_reporter_config(["PythonNative", "python", [get_adjacent_file("python_native_reporter.py")]])
github approvals / ApprovalTests.Python / tests / test_verify.py View on Github external
def test_verify_file(self):
        name = "testFile.txt"
        filename = get_adjacent_file(name)
        verify_file(filename, self.reporter)
github approvals / ApprovalTests.Python / approvaltests / reporters / generic_diff_reporter_factory.py View on Github external
def __init__(self):
        self.load(get_adjacent_file('reporters.json'))
        self.add_fallback_reporter_config(["PythonNative", "python", [get_adjacent_file("python_native_reporter.py")]])
github approvals / ApprovalTests.Python / tests / test_asserts.py View on Github external
def test_assert_against_file_works(self):
        file_path = get_adjacent_file("manual_file.approved.txt")
        assert_against_file("This text is in a file", file_path)
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)