{"enrichment":{"faq":[{"a":"python-testing-patterns teaches you to write pytest tests by starting with simple test functions prefixed with `test_`, organizing them into classes, and using assertions. You'll learn naming conventions, test discovery, how to structure test files alongside your code, and best practices for readable, maintainable tests that catch real bugs.","q":"How to write pytest tests in Python?"},{"a":"python-testing-patterns covers pytest fixtures as reusable test setup components defined with `@pytest.fixture` that eliminate duplication. For mocking, you'll learn to replace external dependencies (APIs, databases, files) with stubs using `unittest.mock` or `pytest-mock`, isolate units under test, and verify interactions without side effects.","q":"What are pytest fixtures and how do I use mocking?"},{"a":"python-testing-patterns shows how to organize test suites by grouping related tests in classes or modules, using conftest.py for shared fixtures, applying pytest markers to categorize tests, and configuring pytest.ini or pyproject.toml for discovery rules. You'll structure tests for unit, integration, and end-to-end layers.","q":"How do I set up test suites with pytest?"},{"a":"python-testing-patterns helps you measure coverage with pytest-cov, identify untested branches, and set coverage thresholds in CI/CD. You'll learn to write meaningful assertions, avoid flaky tests through proper isolation and cleanup, use parameterization to test multiple scenarios, and apply test-driven development to guide design.","q":"How can I improve code coverage and test quality?"},{"a":"python-testing-patterns teaches debugging failing tests by using pytest's `-vv` flag for detailed output, `--pdb` for interactive debugging, and `--lf` to rerun last failures. You'll learn to isolate test dependencies, control time with freezegun, verify mock calls, and recognize test isolation issues that cause flakiness.","q":"What debugging techniques help when tests fail?"},{"a":"python-testing-patterns emphasizes writing tests before code, using red-green-refactor cycles, and organizing tests to drive API design. You'll learn integration testing for Python APIs, async testing with pytest-asyncio, property-based testing for edge cases, and database testing patterns that support TDD workflows.","q":"How does python-testing-patterns support test-driven development?"}],"shadow_tags":["unit-testing","test-automation","mock-objects","code-coverage","test-infrastructure","continuous-integration","quality-assurance","behavior-verification","test-fixtures"],"summary_rewrite":"Learn to build reliable Python tests using pytest, fixtures, mocking, and test-driven development. This skill covers test organization, naming conventions, retry logic, time control with freezegun, markers, and coverage reporting to help you write maintainable test suites."},"files":[{"bytes":7282,"path":"plugins/python-development/skills/python-testing-patterns/SKILL.md","sha256":"a1020718f31629c2a5b20731cad1804dbb81b18800495c5cebdf16e6cac9c175","url":"https://skillfed.io/files/wshobson/agents/python-testing-patterns/165d0488/SKILL.md"}],"id":"wshobson/agents/python-testing-patterns","links":{"html":"https://skillfed.io/wshobson/agents/python-testing-patterns","md":"https://skillfed.io/wshobson/agents/python-testing-patterns.md","repo":"https://github.com/wshobson/agents"},"meta":{"agents_supported":[],"first_seen":"2026-07-28","forks":4097,"language":"Python","last_updated":"2026-07-22","license":"MIT","name":"python-testing-patterns","publisher":"wshobson","stars":38308},"relations":{"similar":[{"id":"xu-xiang/everything-claude-code-zh/python-testing"},{"id":"affaan-m/ECC/python-testing"},{"id":"hieutrtr/ai1-skills/pytest-patterns"},{"id":"manutej/luxor-claude-marketplace/pytest-patterns"},{"id":"manutej/luxor-claude-marketplace/pytest"},{"id":"dawiddutoit/custom-claude/kafka-integration-testing"},{"id":"xu-xiang/everything-claude-code-zh/django-tdd"},{"id":"bobmatnyc/claude-mpm-skills/pytest"},{"id":"pluginagentmarketplace/custom-plugin-data-engineer/etl-tools"},{"id":"dawiddutoit/custom-claude/pytest-adapter-integration-testing"}]},"slug":{"owner":"wshobson","repo":"agents","skill":"python-testing-patterns"},"version":"165d0488"}
