mcpField
T
testing-python

testing-python

github.com/thebeardedbearsasTesting & quality107205 installsUpdated today
Repository

About testing-python

A testing strategy skill for Python 3.14+ projects. It outlines testing and quality-check practices using pytest, Ruff, mypy, Playwright, and related tools.

Key features

  1. 01Use pytest for unit and integration tests
  2. 02Check and format code with Ruff
  3. 03Run strict type checks with mypy
  4. 04Use Playwright, Hypothesis, and Mutmut

Use cases

  1. 01Write tests for FastAPI or Django backends
  2. 02Configure linting, formatting, and type checks in CI
  3. 03Verify browser flows with Playwright
  4. 04Assess test quality with property and mutation testing

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/thebeardedbearsas/claude-craft --skill testing-python

After installing, type/testing-pythonin Claude Code to confirm it loaded.

Bundled filesREFERENCE.md

Details

From the project README

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

TypeOutilUsage
Unit/Integrationpytest 9.xTests backend FastAPI/Django
Linting + FormatRuff 0.17+10-100× plus rapide que Black+Flake8
Type checkingmypy 2.x strictVérification statique
E2E/BrowserPlaywrightTests frontend web
BDD (Gherkin)pytest-bddScénarios Given/When/Then
MutationMutmutQualité des tests (score >= 80%)
Property-basedHypothesisGénération de cas de test automatique

Sources : pytest, Ruff, Mutmut

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

TypeVérification
UnitIsolation totale, fixtures pytest, mocks unittest.mock
IntegrationTestClient FastAPI / Client Django, DB de test
E2EPlaywright sync_api, expect() assertions
PropertyHypothesis @given pour edge cases automatiques
Mutationmutmut run, score >= 80 avant merge

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

Comments

Markdown supported