Documentation Index
Fetch the complete documentation index at: https://astronomer-preview.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
The behavior and format of this command are the same for both Astro and Astro Private Cloud.
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.
The command runs pytest in a container. If your test generates artifacts, such as code coverage reports, you can output the artifacts to the include folder of your Astro project so they can be accessed after the test has finished.
For more information on this functionality, see Test your Astro project locally.
This command requires Astro Runtime version
4.1.0+. For more information, seeAstro Runtime Release Notes.Usage
Options
| Option | Description | Possible Values |
|---|---|---|
<pytest-filepath> | The filepath to an alternative pytest file or directory. Must be within the tests directory | Any valid filepath within the tests directory |
-a, --args | Arguments to pass to pytest. Surround the args in quotes. | Any set of pytest command arguments surrounded by quotes |
--build-secrets | Run docker build --secret to mount a secret value to your Docker image. | id=<your-secret-id>, src=<path-to-secret> . See Docker documentation. |
-e, --env | The filepath to your environment variables. The default is .env) | Any valid filepath within your Astro project |
-i, --image-name | The name of a pre-built custom Docker image to use with your project. The image must be available on your local machine. | A valid name for a pre-built Docker image based on Astro Runtime |