Skip to content

Add debug Python environment details to pytest validation in run_all.py#518

Merged
MobyDickDick merged 2 commits intomainfrom
codex/use-pytest-from-.ven-environment-7jfddu
Jan 4, 2026
Merged

Add debug Python environment details to pytest validation in run_all.py#518
MobyDickDick merged 2 commits intomainfrom
codex/use-pytest-from-.ven-environment-7jfddu

Conversation

@MobyDickDick
Copy link
Copy Markdown
Owner

Motivation

  • Provide visibility into the exact Python environment used to run tests to help diagnose No module named pytest and similar import errors.
  • Surface interpreter metadata such as sys.executable, sys.prefix, sys.base_prefix, PYTHONHOME, PYTHONPATH, VIRTUAL_ENV, and sys.path for debugging.
  • Keep these diagnostics off by default and enable them only when TINYLANGUAGE_DEBUG_PYTEST=1 to avoid noisy output during normal runs.
  • Make it easier to reproduce and investigate environment-related failures from the run_all.py runner and VS Code debug profile.

Description

  • Add a debug-only environment diagnostics step to src/run_all.py that runs PYTEST_PYTHON -c "..." to print interpreter and environment details when validating pytest availability.
  • Print both stdout and stderr from the diagnostics command so the full output is visible in the runner output.
  • Keep diagnostics conditional on the TINYLANGUAGE_DEBUG_PYTEST environment variable and reuse the resolved repository interpreter stored in PYTEST_PYTHON.
  • Update VS Code config to help enable the debug path by setting TINYLANGUAGE_DEBUG_PYTEST in the Python: run_all.py launch profile and prefer the repository venv in settings.json.

Testing

  • No automated tests were executed for these changes.

Codex Task

@MobyDickDick MobyDickDick merged commit d601156 into main Jan 4, 2026
2 checks passed
@MobyDickDick MobyDickDick deleted the codex/use-pytest-from-.ven-environment-7jfddu branch January 4, 2026 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant