AgentSkillsCN

test-validate

使用项目虚拟环境运行 Python 测试。

SKILL.md
--- frontmatter
name: test-validate
description: Run Python tests using the project venv

Commands

bash
# Run all tests
.venv/bin/pytest

# Run specific test file
.venv/bin/pytest tests/test_<name>.py -v

# Run with coverage
.venv/bin/pytest --cov=src

# Run server (dev mode)
.venv/bin/python src/server/main.py --dev

Test Coverage Guidelines

After making code changes, consider whether tests are needed:

Change TypeTest Recommendation
Bug fixAdd regression test to prevent recurrence
New featureUnit tests + integration test if affects multiple modules
RefactorExisting tests should pass; add tests if behavior changes
Config/docsUsually no tests needed

For bug fixes, ensure the test would have failed before the fix and passes after.