Agent skill · software engineering · aiskillstore
pytest-mastery
Python testing with pytest using uv package manager. Use when: (1) Running Python tests, (2) Writing test files or test functions, (3) Setting up fixtures, (4) Parametrizing tests, (5) Generating coverage reports, (6) Testing FastAPI applications, (7) Debugging test failures, (8) Configuring pytest options. Triggers: "run tests", "write tests", "test coverage", "pytest", "unit test", "integration test", "test FastAPI".
Why this skill is useful
Adds specific pytest commands and configurations for testing Python applications that the AI wouldn't reliably generate on its own.
What it needs
Requires httpx, pytest, pytest-asyncio, pytest-cov, uv installed locally. About 3k tokens when loaded. Last updated 2026-08-07. 405 stars on the source repository.
What this skill does
pytest Testing with uv Quick Reference Installation Test Discovery pytest automatically discovers tests following these conventions: Files: test.py or test.py Functions: test Classes: Test (no init method) Methods: test inside Test classes Standard project structure: Fixtures Fixtures provide reusable test setup/teardown: Fixture Scopes Shared Fixtures (conftest.py) Place in tests/conftest.py for automatic availability: Parametrization Run same test with multiple inputs: Common Options Option Description -------- ------------- -v Verbose output -vv More verbose -q Quiet mode -x Stop on first failure --lf Run last failed tests only --ff Run failures first -k "expr" Filter by name expression -m "mark" Run marked tests only --tb=short Shorter traceback --tb=no No traceback -s Show print statements --durations=10 Show 10 slowest tests -n auto Parallel execution (pytest-xdist) Coverage Reports Markers Run by marker: pyproject.toml Configuration FastAPI Testing See references/fastapi-testing.md for comprehensive FastAPI testing patterns including: TestClient setup Async testing with httpx Database fixture patterns Dependency overrides Authentication testing Debugging Failed Tests
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills aiskillstore/pytest-mastery