MindPy uses pytest for unit and integration tests. The development extras in
pyproject.toml include the test runner, asyncio support, coverage, ruff, and
mypy.
pip install -e ".[dev]"Install optional groups when you want to exercise optional surfaces:
pip install -e ".[dev,api,llm]"API tests are skipped automatically if FastAPI's test client is unavailable. LLM provider tests avoid network calls and use local fake providers unless a test explicitly targets an external provider boundary.
pytestRun unit-marked tests:
pytest -m unitRun integration-marked tests:
pytest -m integrationRun a focused module:
pytest tests/test_protocol.py -vpytest --cov=mindpy --cov-report=term-missingGenerate an HTML coverage report:
pytest --cov=mindpy --cov-report=htmlOpen htmlcov/index.html in a browser to inspect missed lines.
ruff check .
mypy mindpyThe suite is designed to be deterministic and offline by default. Tests that
need filesystem state should use tmp_path; external services, network calls,
and long-running bot connections should be replaced with boundary fakes or
standard-library mocks.