SKILL

python-testing

Python testing best practices using pytest including fixtures, parametrization, mocking, coverage analysis, async testing, and test organization. Use when writing or improving Python tests.

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
  • Testing Framework
  • Basic Test Structure
  • Test Discovery
  • Fixtures
  • Fixture Scopes
  • Fixture Dependencies
  • Parametrization

This skill provides comprehensive Python testing patterns using pytest as the primary testing framework. Use pytest as the testing framework for its powerful features and clean syntax. pytest automatically discovers tests following these conventions: Files: test.py or test.py Functions: test Classes: Test (without init) Methods: test Fixtures provide reusable test setup and teardown: Test multiple inputs with @pytest.mark.parametrize: Use markers for test categorization and selective execution: Run specific markers: Using hypothesis for property-based testing: 1. One assertion per test (when possible) 2. Use descriptive test names - describe what's being tested 3. Arrange-Act-Assert pattern - clear test structure 4. Use fixtures for setup - avoid duplication 5. Mock external dependencies - keep tests fast and isolated 6. Test edge cases - empty inputs, None, boundaries 7. Use parametrize - test multiple scenarios efficiently 8. Keep tests independent - no shared state between tests Writing new Python tests Improving test coverage Setting up pytest infrastructure Debugging flaky tests Implementing integration tests Testing async Python code

Source repository
affaan-m/ECC
Source file
.kiro/skills/python-testing/SKILL.md
Fixed revision
d2ef2680594f9a17526a6e1a2e18b3d242c5d17b
Read the complete original documentation ↗

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-09T14:01:48.645Z.

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.