Python
pytest Commands
The most popular Python testing framework. Write simple tests with assert statements, use powerful fixtures, and generate coverage reports.
11 commands
Pro Tips
Use '-x' to stop on first failure, '-v' for verbose output.
Name test files 'test_*.py' and functions 'test_*' for auto-discovery.
Use '@pytest.mark.parametrize' to run tests with multiple inputs.
Common Mistakes
Use '-s' flag to see print statements - pytest captures output by default.
Install pytest-cov separately for coverage reports.