Skip to content

Latest commit

 

History

History
71 lines (49 loc) · 1.29 KB

testing.md

File metadata and controls

71 lines (49 loc) · 1.29 KB

Testing

MindPy uses pytest for unit and integration tests. The development extras in pyproject.toml include the test runner, asyncio support, coverage, ruff, and mypy.

Install Test Dependencies

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.

Run Tests

pytest

Run unit-marked tests:

pytest -m unit

Run integration-marked tests:

pytest -m integration

Run a focused module:

pytest tests/test_protocol.py -v

Coverage

pytest --cov=mindpy --cov-report=term-missing

Generate an HTML coverage report:

pytest --cov=mindpy --cov-report=html

Open htmlcov/index.html in a browser to inspect missed lines.

Static Checks

ruff check .
mypy mindpy

The 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.