GitHub user tuzonghua created a discussion: What is the recommended approach 
for testing custom operators outside an Airflow code base?

If I'm building and distributing an internal Airflow provider, for example, a 
repository that only contains custom operators, hooks, etc., but no DAGs, what 
is the best way to write integration tests for that code? Official Airflow 
providers often use the 
[dag_maker](https://github.com/apache/airflow/blob/3.3.1/devel-common/src/tests_common/pytest_plugin.py#L1048)
 fixture as a convenient way to write unit tests 
([example](https://github.com/apache/airflow/blob/main/providers/snowflake/tests/unit/snowflake/operators/test_snowpark.py#L83))
 that create an in-memory DAG. However, the [official 
documentation](https://github.com/apache/airflow/pull/71542) suggests 
`dag.test()`, which requires a separate DAG file to exist in a configured DAG 
bundle. If the latter is the answer, will official Airflow providers be 
migrating to that approach as well?

GitHub link: https://github.com/apache/airflow/discussions/72120

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: [email protected]

Reply via email to