How to use the approvaltests.TextDiffReporter.TextDiffReporter 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_textdiffreporter.py View on Github external
def instantiate_reporter_for_test():
        reporter = TextDiffReporter()
        reporter.run_command = lambda command_array: None
        return reporter
github approvals / ApprovalTests.Python / tests / test_textdiffreporter.py View on Github external
def setUp(self):
        if os.path.exists(self.tmp_dir):
            shutil.rmtree(self.tmp_dir)
        os.mkdir(self.tmp_dir)
        self.diff_tool = 'echo'
        self.set_environment_variable(
            TextDiffReporter.DIFF_TOOL_ENVIRONMENT_VARIABLE_NAME,
            self.diff_tool
        )
github approvals / ApprovalTests.Python / approvaltests / TextDiffReporter.py View on Github external
def __init__(self):
        if self.DIFF_TOOL_ENVIRONMENT_VARIABLE_NAME not in os.environ:
            raise ReporterMissingException(self.DIFF_TOOL_ENVIRONMENT_VARIABLE_NAME)
        diff_tool = os.environ[self.DIFF_TOOL_ENVIRONMENT_VARIABLE_NAME]
        super(TextDiffReporter, self).__init__(('Custom', diff_tool))
github approvals / ApprovalTests.Python / examples / text_diff_reporter_example.py View on Github external
def test(self):
        reporter = TextDiffReporter()
        approvals.verify("x", reporter)