'This test checks function set_dag_run_state with mixed task instance
state.'

def test_set_mixed_dag_run_state(self):

    date = self.execution_dates[0]
    dr = self.dag1.create_dagrun(run_id=('manual__' + datetime.now().isoformat()), state=State.FAILED, execution_date=date, session=self.session)
    dr.get_task_instance('runme_0').set_state(State.SUCCESS, self.session)
    dr.get_task_instance('runme_1').set_state(State.SKIPPED, self.session)
    dr.get_task_instance('runme_2').set_state(State.UP_FOR_RETRY, self.session)
    dr.get_task_instance('also_run_this').set_state(State.QUEUED, self.session)
    dr.get_task_instance('run_after_loop').set_state(State.RUNNING, self.session)
    dr.get_task_instance('run_this_last').set_state(State.FAILED, self.session)
    altered = set_dag_run_state(self.dag1, date, state=State.SUCCESS, commit=True)
    self.assertEqual(len(altered), (len(self.dag1.tasks) - 1))
    self.verify_dag_run_states(self.dag1, date)
