Skip to content
Back to skills

Testing Python

ASecurity

Stratégie de Tests Python 3.14+. Use when writing tests, reviewing test coverage, or setting up testing.

  • 109 stars
  • 0 votes
  • 0 copies
  • 11 views
  • Added September 5, 2026
developmentpythongofastapidjangotestingapifrontendbackend

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned November 9, 2026

npx -y skills add TheBeardedBearSAS/claude-craft --skill testing-python --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Testing Python?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Testing Python
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/thebeardedbearsas-testing-python-claude-craft/badge)](https://www.skillsdirectory.com/skills/thebeardedbearsas-testing-python-claude-craft)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: testing-python
description: Stratégie de Tests Python 3.14+. Use when writing tests, reviewing test coverage, or setting up testing.
context: fork
---

# 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](https://docs.pytest.org/), [Ruff](https://docs.astral.sh/ruff/), [Mutmut](https://mutmut.readthedocs.io/)

## Invariants non-négociables

- Couverture >= 80% (`--cov-fail-under=80` dans `pyproject.toml`)
- mypy strict — zéro `Any` non justifié, `disallow_untyped_defs = true`
- Ruff obligatoire (check + format) dans CI
- Pattern AAA (Arrange-Act-Assert) dans chaque test
- Fixtures pytest pour l'injection de dépendances (pas d'état global)
- Mutation score >= 80% via Mutmut

## 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](./REFERENCE.md)

Files in this skill

  • REFERENCE.md4.4 KB
  • SKILL.md1.8 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.