airflow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ry Walker (JIRA)" <j...@apache.org>
Subject [jira] [Assigned] (AIRFLOW-7) Unit test for ExternalTaskSensor depends on a different unit test
Date Mon, 03 Sep 2018 19:00:00 GMT

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

Ry Walker reassigned AIRFLOW-7:
-------------------------------

    Assignee:     (was: Ry Walker)

> 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)

Mime
View raw message