Grove for PythonA VS Code extension that adds Python test runner support to Grove (pytest and unittest). This extension integrates with OverviewGrove for Python activates alongside Grove Core when a workspace contains a
Requirements
PyMongo setupFrom
Grove runs the same unittest command using Commands
Architecture
Extension ActivationOn activation, the extension:
Test RunnerThe test runner (
|
| Project type | Command |
|---|---|
PyMongo-style (tests_package/, no pytest config) |
python -m unittest discover tests_package |
pytest (pytest.ini or [tool.pytest] in pyproject.toml) |
python -m pytest --tb=short -q |
| Single file | python -m unittest <relative-path> or scoped pytest path |
Interpreter resolution (in order):
- Project
venv/bin/pythonor.venv/bin/python - VS Code's Python: Default Interpreter Path setting
- System
python3/python
The output channel shows Using Python: ... so you can verify which interpreter ran.
Also:
- pytest:
-ktest name filtering viatestNamePatternwhen provided - unittest discover:
-kis passed whentestNamePatternis set (supported since Python 3.7) - unittest single file:
testNamePatternis ignored;-kis not passed for a single module path (reliable only on Python 3.12+ if we did pass it) - Injects environment variables (including
CONNECTION_STRINGfrom Grove UI) - Enforces timeout limits (default: 60s, max: 300s)
- If the interpreter cannot be spawned (missing binary, permission), the run fails immediately with a clear error instead of hanging until timeout
Integration with Grove Core
Grove for Python is a companion extension that extends Grove Core's functionality. When users run Grove: Run Tests (the core command), Grove Core automatically delegates to this extension's Python runner for Python projects.
Development
From the repository root:
# Install dependencies
pnpm --filter grove-platform-python install
# Build the extension
pnpm --filter grove-platform-python build
# Run tests
pnpm --filter grove-platform-python test
# Watch mode
pnpm --filter grove-platform-python watch