Agent skill · software engineering · aiskillstore

python-pytest-patterns

pytest testing patterns for Python. Triggers on: pytest, fixture, mark, parametrize, mock, conftest, test coverage, unit test, integration test, pytest.raises.

Why this skill is useful

Provides specific pytest patterns and advanced testing techniques that the AI wouldn't reliably generate on its own.

What it needs

About 2k tokens when loaded. Last updated 2026-08-07. 405 stars on the source repository.

What this skill does

Python pytest Patterns Modern pytest patterns for effective testing. Basic Test Structure Fixtures Fixture Scopes Parametrize Exception Testing Markers Mocking pytest-mock (Recommended) conftest.py Quick Reference Command Description --------- ------------- pytest Run all tests pytest -v Verbose output pytest -x Stop on first failure pytest -k "testname" Run matching tests pytest -m slow Run marked tests pytest --lf Rerun last failed pytest --cov=src Coverage report pytest -n auto Parallel (pytest-xdist) Additional Resources ./references/fixtures-advanced.md - Factory fixtures, autouse, conftest patterns ./references/mocking-patterns.md - Mock, patch, MagicMock, sideeffect ./references/async-testing.md - pytest-asyncio patterns ./references/coverage-strategies.md - pytest-cov, branch coverage, reports ./references/integration-testing.md - Database fixtures, API testing, testcontainers ./references/property-testing.md - Hypothesis framework, strategies, shrinking ./references/test-architecture.md - Test pyramid, organization, isolation strategies Scripts ./scripts/run-tests.sh - Run tests with recommended options ./scripts/generate-conftest.sh - Generate conftest.py boilerplate Assets ./assets/pytest.ini.template - Recommended pytest configuration ./assets/conftest.py.template - Common fixture patterns --- See Also Related Skills: python-typing-patterns - Type-safe test code python-async-patterns - Async test patterns (pytest-asyncio) Testing specific frameworks: python-fastapi-patterns - TestClient, API testing python-database-patterns - Database fixtures, transactions

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills aiskillstore/python-pytest-patterns

View the source on GitHub

Browse the @skills marketplace