An example unit test for a DAG

## Code sample

### Python


To authenticate to Managed Airflow, set up Application Default Credentials.
For more information, see

[Set up authentication for a local development environment](https://docs.cloud.google.com/docs/authentication/set-up-adc-local-dev-environment).

    def test_dag_with_variables(set_variables):
        # Importing the module verifies that there are no syntax errors.
        from . import unit_testing_variables as module

        # The assert_has_valid_dag verifies that the module contains an Airflow DAG
        # and that the DAG contains no cycles.
        internal_unit_testing.assert_has_valid_dag(module)

## What's next


To search and filter code samples for other Google Cloud products, see the
[Google Cloud sample browser](https://docs.cloud.google.com/docs/samples?product=cloudcomposer).