dag_file = os.path.join(TEST_DAGS_FOLDER, "test_example_bash_operator.py")
        temp_dagfile = os.path.join(tmpdir, TEMP_DAG_FILENAME)
        with open(dag_file) as main_dag, open(temp_dagfile, "w") as next_dag:
            for line in main_dag:
                next_dag.write(line)
        
        self._process_file(temp_dagfile, dag_directory=tmpdir, session=session)
        
        dm = session.query(DagModel).filter(DagModel.fileloc == temp_dagfile).first()
        assert not dm.has_import_errors
        
        with open(temp_dagfile, "a") as file:
            file.writelines(UNPARSEABLE_DAG_FILE_CONTENTS)
        self._process_file(temp_dagfile, dag_directory=tmpdir, session=session)
        import_errors = session.query(errors.ImportError).all()
        assert len(import_errors) == 1
        import_error = import_errors[0]
        assert import_error.filename == temp_dagfile
        assert import_error.stacktrace
        dm = session.query(DagModel).filter(DagModel.fileloc == temp_dagfile).first()
        assert dm.has_import_errors
    def test_no_import_errors_with_parseable_dag(self, tmpdir):