pytest-optimizer

Analyze pytest suites to reduce runtime and detect flaky tests.

2|1|Updated Jan 25, 2026
One-click install
npx skills add https://github.com/jorgealves/agent_skills --skill pytest-optimizer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pytest-optimizer
Source: https://github.com/jorgealves/agent_skills/tree/main/pytest-optimizer
Command: npx skills add https://github.com/jorgealves/agent_skills --skill pytest-optimizer

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Analyze and optimize pytest suites to improve speed, identify flaky tests, and increase coverage. Use to maintain high-quality, fast-running test pipelines.

Core Features & Use Cases

  • Test speed optimization: Identify slow tests and optimize execution order to reduce runtime.
  • Flaky test detection: Pinpoint flaky tests and provide recommendations to stabilize them.
  • Coverage awareness: Assess test coverage trends and suggest improvements for critical paths.
  • Use Case: When maintaining a large Python codebase with a lengthy CI pipeline, use this Skill to accelerate test runs and improve reliability.

Quick Start

Run: pytest-optimizer --project-path .

Frequently Asked Questions about pytest-optimizer

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

FAQPage Schema
How do I optimize pytest suite runtime and reduce flaky tests in my Python project?

To optimize pytest suite performance, you need a valid Python environment to assess test structure and execution order. This identifies slow tests and detects flaky tests to reduce overall runtime and improve CI pipeline reliability.

What is flaky test detection and how does it improve CI pipeline reliability?

Flaky test detection analyzes your pytest suite to pinpoint tests with inconsistent results. By identifying these unstable tests, you can apply recommendations to stabilize them, which directly improves test reliability and prevents false CI failures.

Can I analyze test coverage trends for legacy Python codebases using pytest?

Yes, you can assess test coverage trends for legacy Python codebases. The analysis evaluates coverage metrics and suggests improvements for critical paths, helping you maintain high-quality test pipelines even in older projects.

Do I need a specific Python environment setup to analyze and optimize my pytest suite?

Yes, you need a valid Python environment and a PyTest-based project to run the optimization analysis. The tool requires this setup to accurately assess your test structure, performance metrics, and coverage data.

How do I find the slowest tests in my pytest suite and improve execution order?

To find the slowest tests in your pytest suite, run an analysis on your project path to identify performance bottlenecks. The optimization process then restructures the execution order to minimize overall test runtime.