airflow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeremiah Lowin (JIRA)" <j...@apache.org>
Subject [jira] [Created] (AIRFLOW-7) Unit test for ExternalTaskSensor depends on a different unit test
Date Wed, 27 Apr 2016 00:05:12 GMT
Jeremiah Lowin created AIRFLOW-7:
------------------------------------

             Summary: Unit test for ExternalTaskSensor depends on a different unit test
                 Key: AIRFLOW-7
                 URL: https://issues.apache.org/jira/browse/AIRFLOW-7
             Project: Apache Airflow
          Issue Type: Bug
            Reporter: Jeremiah Lowin
            Priority: Minor


The unit test {{core:CoreTest.test_external_task_sensor}} appears to depend on the result
of a different unit test. I discovered this when I created a {{tearDown()}} method that deleted
any TaskInstances created by a unit test. I think it's bad to have cross-test dependencies,
especially since I'm not sure if there is a guarantee about unit test run order.

Full test:
{code}
    def test_external_task_sensor_delta(self):
        t = operators.ExternalTaskSensor(
            task_id='test_external_task_sensor_check_delta',
            external_dag_id=TEST_DAG_ID,
            external_task_id='time_sensor_check',
            execution_delta=timedelta(0),
            allowed_states=['success'],
            dag=self.dag)
        t.run(start_date=DEFAULT_DATE, end_date=DEFAULT_DATE, force=True)
{code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message