skills sourced live from GitHub · all skills listed are free · each skill is provided under its author's license.
home / Testing & QA / Python Testing Patterns Skill by @wshobson
The skill is the plugins/python-development/skills/python-testing-patterns folder inside that repository. Copy it into the folder your agent loads skills from; check your agent's documentation for where that is.
Implement comprehensive testing strategies with pytest, fixtures, mocking, and test-driven development.
Covers pytest-based testing: test types, arrange-act-assert structure, coverage, isolation, fixtures, mocking and test-driven development. It is organised around test types, the arrange-act-assert structure, coverage and isolation, so a new pytest suite starts with a clear shape.
The original SKILL.md is organised into these sections:
Written and maintained by @wshobson. It is published under the MIT license, which allows reuse with attribution. See the author profile. SkillDirectory does not claim authorship: this page adds our own review and links back to the original, and the skill's text belongs to its author.
# Python Testing Patterns Comprehensive guide to implementing robust testing strategies in Python using pytest, fixtures, mocking, parameterization, and test-driven development practices. ## When to Use This Skill - Writing unit tests for Python code - Setting up test suites and test infrastructure - Implementing test-driven development (TDD) - Creating integration tests for APIs and services - Mocking external dependencies and services - Testing async code and concurrent operations - Setting up continuous testing in CI/CD - Implementing property-based testing - Testing database operations - Debugging failing tests ## Core Concepts ### 1. Test Types - **Unit Tests**: Test individual functions/classes in isolation - **Integration Tests**: Test interaction between components - **Functional Tests**: Test complete features end-to-end - **Performance Tests**: Measure speed and resource usage ### 2. Test Structure (AAA Pattern) - **Arrange**: Set up test data and preconditions …
Excerpt only, quoted from the author's repository. Open the repository for the complete file.