What problem does it solve?
This Skill addresses the challenges of overly large, duplicated, and hard-to-maintain Python test suites, making them more readable, efficient, and easier to manage.
Core Features & Use Cases
- Parametrization: Consolidates repetitive test functions into single, parametrized tests using
pytest.mark.parametrize.
- Sync/Async Deduplication: Merges mirrored sync and async test classes into a single test function using helpers like
_maybe_await.
- Modularization: Guides the splitting of large test files into smaller, focused modules based on feature areas.
- Use Case: Refactor a test file with over 700 lines and many copy-pasted test functions into a more maintainable structure with parametrized tests and smaller modules.
Quick Start
Use the test-refactoring skill to refactor the file 'tests/test_cql_builder.py' by applying parametrization patterns.