Testing python

From TheBeardedBearSAS/claude-craft · View interactive version

Testing python is an AI agent skill from the GitHub repository TheBeardedBearSAS/claude-craft. Stratégie de Tests Python 3.14+. Use when writing tests, reviewing test coverage, or setting up testing.

How to use this skill

Skill file

Stratégie de Tests Python 3.14+

Versions : Python 3.14+ | pytest 9.x | Ruff 0.17+ | mypy 2.x | Playwright

Ruff remplace Black + isort + Flake8 (10-100x plus rapide). mypy strict élimine les bugs de type à la compilation.

Stack recommandée 2026

| Type | Outil | Usage |

|------|-------|-------|

| Unit/Integration | pytest 9.x | Tests backend FastAPI/Django |

| Linting + Format | Ruff 0.17+ | 10-100× plus rapide que Black+Flake8 |

| Type checking | mypy 2.x strict | Vérification statique |

| E2E/Browser | Playwright | Tests frontend web |

| BDD (Gherkin) | pytest-bdd | Scénarios Given/When/Then |

| Mutation | Mutmut | Qualité des tests (score >= 80%) |

| Property-based | Hypothesis | Génération de cas de test automatique |

Sources : pytest, Ruff, Mutmut

Invariants non-négociables

Checklist par type

| Type | Vérification |

|------|-------------|

| Unit | Isolation totale, fixtures pytest, mocks unittest.mock |

| Integration | TestClient FastAPI / Client Django, DB de test |

| E2E | Playwright sync_api, expect() assertions |

| Property | Hypothesis @given pour edge cases automatiques |

| Mutation | mutmut run, score >= 80 avant merge |

Détails complets, exemples de code, configs et checklists : voir REFERENCE.md

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.