test-refactoring

Refactor Python pytest suites by merging overlaps, parameterizing duplicates, and pruning dead coverage.

5|4|Updated Apr 8, 2026
One-click install
npx skills add https://github.com/haakonbull/autosprint --skill test-refactoring-haakonbull
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-refactoring
Source: https://github.com/haakonbull/autosprint/tree/main/.claude/skills/test-refactoring
Command: npx skills add https://github.com/haakonbull/autosprint --skill test-refactoring-haakonbull

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pytest, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill helps refactor test suites, eliminating overlap and bloat without compromising coverage. It is used to clean up tests and improve maintainability without risk of coverage loss.

Core Features & Use Cases

  • Consolidate Tests: Identifies and merges overlapping tests.
  • Parametrise Tests: Converts identical tests into a single parametrized test to reduce duplication.
  • Prune Dead Coverage: Removes tests that no longer contribute to coverage.

Quick Start

Run test-refactoring my_tests_directory to start refactoring tests in 'my_tests_directory'.

Frequently Asked Questions about test-refactoring

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I refactor pytest test suites to remove duplicate tests?

To refactor pytest test suites, this Skill detects overlapping tests and merges them by converting identical tests into a single parametrized test to reduce duplication.

Can I clean up bloated tests without losing code coverage?

You can clean up bloated tests without losing code coverage because this Skill prunes dead coverage and eliminates overlap using a safety-first consolidation approach.

What is the best way to automate test consolidation in a CI pipeline?

Automating test consolidation in a CI pipeline is achieved by running this Skill against your Python test directory to continuously maintain test quality over time.

Does this test refactoring tool work without configuring pytest?

This test refactoring tool requires pytest as a dependency, meaning your existing pytest test suite is directly compatible and requires no additional testing framework setup.

How do I start refactoring tests in my project directory?

To start refactoring tests in your project, run the command `test-refactoring my_tests_directory` to automatically scan and consolidate tests in the specified directory.