python-testing
Python testing strategies using pytest, TDD methodology, fixtures, mocking, parametrization, and coverage requirements. Use when writing pytest tests — fixtures, mocks, parametrization, or coverage.
Target: Software development & testing. Automatically collected · unverified.
Excerpt from the author’s documentation
Extracted from a fixed version of SKILL.md in its original language. This is the author’s documentation; installation, compatibility and runtime results have not been verified by this site.
Read the original English text
Topics in the source
- Python Testing Patterns
- When to Activate
- Core Testing Philosophy
- Test-Driven Development (TDD)
- Coverage Requirements
- pytest Fundamentals
- Basic Test Structure
- Assertions
Comprehensive testing strategies for Python applications using pytest, TDD methodology, and best practices. Writing new Python code (follow TDD: red, green, refactor) Designing test suites for Python projects Reviewing Python test coverage Setting up testing infrastructure Always follow the TDD cycle: 1. RED: Write a failing test for the desired behavior 2. GREEN: Write minimal code to make the test pass 3. REFACTOR: Improve code while keeping tests green Target: 80%+ code coverage Critical paths: 100% coverage required Use pytest --cov to measure coverage ASGITransport does not run lifespan events. Install asgi-lifespan and wrap the client in LifespanManager when the app uses startup or shutdown handlers. See FastAPI's async testing guidance. Follow TDD: Write tests before code (red-green-refactor) Test one thing: Each test should verify a single behavior Use descriptive names: testuserloginwithinvalidcredentialsfails Use fixtures: Eliminate duplication with fixtures Mock external dependencies: Don't depend on external services Test edge cases: Empty inputs, None values, boundary conditions Aim for 80%+ coverage: Focus on critical paths Keep tests fast: Use marks to separate slow
This is an excerpt. Refer to the complete source and its current requirements.
- Source repository
- affaan-m/ECC
- Source file
- pi/core/skills/python-testing/SKILL.md
- Fixed revision
- d2ef2680594f9a17526a6e1a2e18b3d242c5d17b
Sources and evidence
This record was collected automatically. Its documentation, suitability and runtime behavior have not been manually verified.
Author: affaan-m/ECC · original repository metadata. Documentation review: Not reviewed. Last source check: 2026-11-09T15:01:43.204Z.
Categories are inferred from names, descriptions and paths. They do not establish compatibility.
License and attribution
MIT. Third-party content and copyright remain with their authors. Refer to the original license and terms.
Original license ↗Synchronization, copying and user-reported success do not mark a resource as runtime-tested.
Limitations and notes
- Collecting metadata does not mean this site has installed, adapted, runtime-tested or security-reviewed the resource.