pytest
Installation
SKILL.md
Pytest
Pytest is the dominant testing framework for Python. It is loved for its no-boilerplate syntax (assert x == y), powerful fixture system, and rich plugin ecosystem.
When to Use
- Python Projects: The standard for 99% of new Python projects.
- Complex Setup: Use Fixtures to handle database connections, API clients, or mock data.
- Parametrization: Running the same test with different inputs.
Quick Start
# content of test_sample.py
def inc(x):
return x + 1