You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by po...@apache.org on 2022/02/20 23:03:48 UTC

[airflow] branch main updated: Fix import in unit test example (#21703)

This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 9f8278e  Fix import in unit test example (#21703)
9f8278e is described below

commit 9f8278ecab21ca4721f96a4430f2ff9f3d4c3acc
Author: Kevin <ye...@gmail.com>
AuthorDate: Sun Feb 20 18:02:59 2022 -0500

    Fix import in unit test example (#21703)
---
 docs/apache-airflow/best-practices.rst | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/docs/apache-airflow/best-practices.rst b/docs/apache-airflow/best-practices.rst
index 4dddaa53..c1e1bfb 100644
--- a/docs/apache-airflow/best-practices.rst
+++ b/docs/apache-airflow/best-practices.rst
@@ -491,7 +491,7 @@ This is an example test want to verify the structure of a code-generated DAG aga
 
     import pytest
 
-    from airflow.utils.state import DagRunState
+    from airflow.utils.state import DagRunState, TaskInstanceState
     from airflow.utils.types import DagRunType
 
     DATA_INTERVAL_START = pendulum.datetime(2021, 9, 13, tz="UTC")
@@ -526,7 +526,7 @@ This is an example test want to verify the structure of a code-generated DAG aga
         ti = dagrun.get_task_instance(task_id=TEST_TASK_ID)
         ti.task = dag.get_task(task_id=TEST_TASK_ID)
         ti.run(ignore_ti_state=True)
-        assert ti.state == State.SUCCESS
+        assert ti.state == TaskInstanceState.SUCCESS
         # Assert something related to tasks results.