python-testing

pytest、TDD手法、フィクスチャ、モック、パラメータ化、カバレッジ要件を使用したPythonテスト戦略。

Content Preview
---
name: python-testing
description: pytest、TDD手法、フィクスチャ、モック、パラメータ化、カバレッジ要件を使用したPythonテスト戦略。
---

# Pythonテストパターン

pytest、TDD方法論、ベストプラクティスを使用したPythonアプリケーションの包括的なテスト戦略。

## いつ有効化するか

- 新しいPythonコードを書くとき(TDDに従う:赤、緑、リファクタリング)
- Pythonプロジェクトのテストスイートを設計するとき
- Pythonテストカバレッジをレビューするとき
- テストインフラストラクチャをセットアップするとき

## 核となるテスト哲学

### テスト駆動開発(TDD)

常にTDDサイクルに従います。

1. **赤**: 期待される動作のための失敗するテストを書く
2. **緑**: テストを通過させるための最小限のコードを書く
3. **リファクタリング**: テストを通過させたままコードを改善する

```python
# Step 1: Write failing test 
How to Use

Recommended: Install to project (local)

mkdir -p .claude/skills
curl -o .claude/skills/python-testing.md \
  https://raw.githubusercontent.com/affaan-m/everything-claude-code/main/docs/ja-JP/skills/python-testing/SKILL.md

Skill is scoped to this project only. Add .claude/skills/ to your .gitignoreif you don't want to commit it.

Alternative: Clone full repo

git clone https://github.com/affaan-m/everything-claude-code

Then reference at docs/ja-JP/skills/python-testing/SKILL.md

Related Skills