pytest
Installation
SKILL.md
When to use this skill
Use this skill whenever the user wants to:
- Write and run Python unit tests with pytest
- Use fixtures for test setup, teardown, and dependency injection
- Parametrize tests to run with multiple input sets
- Mock dependencies with
pytest-mockorunittest.mock - Configure pytest via
pytest.ini,pyproject.toml, orconftest.py - Generate coverage reports with
pytest-cov - Run tests in parallel with
pytest-xdist
How to use this skill
Workflow
- Write test functions with
test_prefix orTestclass - Use fixtures in
conftest.pyfor shared setup and dependency injection - Run tests with
pytestCLI, applying markers and filters as needed - Analyze results with coverage and reporting plugins