"""
        Test that existing import error is updated and new record not created
        for a dag with the same filename
        """
        filename_to_parse = os.path.join(tmpdir, TEMP_DAG_FILENAME)
        
        with open(filename_to_parse, "w") as file_to_parse:
            file_to_parse.writelines(UNPARSEABLE_DAG_FILE_CONTENTS)
        session = settings.Session()
        self._process_file(filename_to_parse, dag_directory=tmpdir, session=session)
        import_error_1 = (
            session.query(errors.ImportError).filter(errors.ImportError.filename == filename_to_parse).one()
        )
        
        for _ in range(10):
            self._process_file(filename_to_parse, dag_directory=tmpdir, session=session)
        import_error_2 = (
            session.query(errors.ImportError).filter(errors.ImportError.filename == filename_to_parse).one()
        )
        
        assert import_error_1.id == import_error_2.id
    def test_remove_error_clears_import_error(self, tmpdir):