[ 
https://issues.apache.org/jira/browse/AIRFLOW-7?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Fokko Driesprong closed AIRFLOW-7.
----------------------------------
    Resolution: Fixed

> 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
>          Components: tests
>            Reporter: Jeremiah Lowin
>            Priority: Minor
>              Labels: test
>
> 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
(v7.6.3#76005)

Reply via email to