fix(parse): handle PYTEST_THEME env var in DAG integrity test by josh-fell · Pull Request #2028 · astronomer/astro-cli

@josh-fell @claude

When running `astro dev parse`, the monkeypatched os.getenv() returns
MOCKED_PYTEST_THEME_VALUE for unset environment variables. Pytest
validates PYTEST_THEME against known Pygment styles and fails with:

  ERROR: PYTEST_THEME environment variable had an invalid value:
  'MOCKED_PYTEST_THEME_VALUE'. Only valid pygment styles are allowed.

This occurs when Astro projects specify "--color=yes" in pytest configs,
causing pytest to check the PYTEST_THEME environment variable.

Solution: Return None for PYTEST_THEME when no default is provided,
following the same pattern used for the JENKINS_HOME fix (#601).

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

josh-fell

@jlaneve jlaneve deleted the josh-fell/fix-pytest-theme-mock branch

March 5, 2026 02:45