def check_log_file(self):

        self.handler.flush()

        if not os.path.isfile(self.expected_path):
            self.skipTest("Expected log file not found.")
        else:
            try:
                subprocess.check_output(['diff',
                                         self.logfile_path,
                                         self.expected_path])
            except subprocess.CalledProcessError as err:
                self.fail("Log file does not match the expected log file:\n" +
                          err.output)
If an expected logfile exists, check to see if it matches.
dataset/ETHPy150Open GeoscienceAustralia/agdc/tests/test_abstract_ingester.py/TestIngester.check_log_file