Run unit tests for your data pipelines on Astro with
pytest, a testing framework for Python. When you run this command, the Astro CLI creates a local Python environment that includes your DAG code, dependencies, and Astro Runtime Docker image. The CLI then runs any pytests in the
tests directory of your Astro project and shows you the results of those tests in your terminal.
For more information on this functionality, see Test and troubleshoot locally.
This command requires Astro Runtime version
4.1.0+. For more information, see Astro Runtime Release Notes.
astro dev pytest
|The filepath to an alternative pytest file or directory. Must be within the ||Any valid filepath within the |
|The filepath to your environment variables. The default is ||Any valid filepath within your Astro project|
|The name of a pre-built custom Docker image to use with your project. The image must be available from a Docker registry hosted on your local machine||A valid name for a pre-built Docker image based on Astro Runtime|
$ astro dev pytest --env=myAlternativeEnvFile.env
# Specify env file at root of Astro project