Skip to content

Testing

Окно терминала
uv run pytest provider/tests/ -v

With a coverage report:

Окно терминала
uv run pytest provider/tests/ -v --cov=provider/ --cov-report=term-missing

Every push and PR triggers two parallel jobs via test.yml:

JobWhat it does
test-*Runs pytest with coverage checks, uploads report to Codecov
lint-*Runs ruff, mypy, codespell, pre-commit

Tests run against music-assistant/server@dev (no fork — lightweight CI).

ToolPurpose
uvVirtual environment and dependency management
Python 3.12Target language version
pytestTest framework
pytest-covCoverage data collection
CodecovCoverage report upload (automatic in CI)
ruffPython linter and formatter
mypyStatic type analysis
codespellSpell checking in source code
pre-commitPre-commit hooks

Run all pre-commit hooks (recommended before a PR):

Окно терминала
uv run pre-commit run --all-files

Type checking only:

Окно терминала
uv run mypy provider/

Linting only:

Окно терминала
uv run ruff check provider/
uv run ruff format --check provider/

Coverage reports are automatically uploaded to Codecov on every push in CI. To view coverage locally:

Окно терминала
uv run pytest provider/tests/ --cov=provider/ --cov-report=html
open htmlcov/index.html

If tests or linters fail in CI, a GitHub issue is automatically created with the incident:ci label. For more on the incident workflow, see Incident Management.