Testing Anti-Patterns

Detects Python test anti-patterns such as flaky tests, slow tests, fragile fixtures, and excessive assertions via static analysis and optional runtime checks.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/ChunkyTortoise/EnterpriseHub --skill testing-anti-patterns-chunkytortoise
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Testing Anti-Patterns
Source: https://github.com/ChunkyTortoise/EnterpriseHub/tree/main/.claude/skills/testing/testing-anti-patterns
Command: npx skills add https://github.com/ChunkyTortoise/EnterpriseHub --skill testing-anti-patterns-chunkytortoise

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Testing at scale often suffers from flaky, slow, and brittle tests that waste time and obscure real regressions. This Skill identifies and prevents common testing anti-patterns, providing detection strategies and refactoring guidance to improve reliability and maintainability.

Core Features & Use Cases

  • Flaky test detection: identifies tests with non-deterministic outcomes and suggests explicit setup.
  • Performance guards: flags slow tests and proposes targeted speedups and mocks.
  • Fixture isolation: detects fragile fixtures and promotes isolated, repeatable fixtures.
  • Assertion clarity: points to tests with overly broad assertions and recommends focused checks.
  • Independent tests: promotes independent test cases that avoid cross-test dependencies.

Quick Start

Use this skill to audit a tests/ directory for anti-patterns and generate a remediation plan. Then apply recommended fixes and re-run tests to verify improvements.

Frequently Asked Questions about Testing Anti-Patterns

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

FAQPage Schema
How do I identify flaky tests in a pytest suite?

Detect flaky tests in pytest by running static analysis on test code and fixtures to find non-deterministic outcomes, then apply actionable remediation guidance for explicit setup.

What are common testing anti-patterns in Python integration tests?

Common testing anti-patterns in Python integration tests include flaky tests, slow execution, brittle fixtures, excessive assertions, and cross-test dependencies that obscure real regressions.

How do I fix brittle pytest fixtures and improve test isolation?

Improve test isolation by detecting brittle fixtures through static code analysis and refactoring them into isolated, repeatable fixtures that prevent cross-test dependencies.

Can I analyze my existing tests directory for slow tests and performance issues?

Yes, you can audit a tests directory to flag slow tests via performance guards, which propose targeted speedups and mocks to optimize overall test suite execution time.

Does this testing anti-pattern analysis work with any Python testing framework?

The analysis specifically targets Python projects using pytest, applying static code analysis and optional runtime checks to detect anti-patterns across both unit and integration tests.

What is the best way to refactor tests with overly broad assertions?

The best way to refactor tests with overly broad assertions is to analyze assertion clarity and apply recommended focused checks, ensuring the suite validates intended behaviors without brittleness.