·pytest-mocking-strategy
</>

pytest-mocking-strategy

pytest のマスター モック戦略: autospec=True と手動モックをいつ使用するか、非同期コードの AsyncMock パターン、モック ビルダーとファクトリー、絶対にモックしてはいけないもの。タイプセーフなモック作成パターンと、モックと実際のオブジェクトの決定マトリックスが含まれています。 使用場面: モック化された依存関係を含む単体テストの作成、モック化するか実際のオブジェクトを使用するかの決定、テスト分離の設定、外部サービス境界を使用したユース ケースのテスト、または再利用可能なモック ファクトリの構築。

5インストール·0トレンド·@dawiddutoit

インストール

$npx skills add https://github.com/dawiddutoit/custom-claude --skill pytest-mocking-strategy

pytest-mocking-strategy のインストール方法

コマンドラインで pytest-mocking-strategy AI スキルを開発環境にすばやくインストール

  1. ターミナルを開く: ターミナルまたはコマンドラインツール(Terminal、iTerm、Windows Terminal など)を開きます
  2. インストールコマンドを実行: このコマンドをコピーして実行します: npx skills add https://github.com/dawiddutoit/custom-claude --skill pytest-mocking-strategy
  3. インストールを確認: インストール後、スキルは自動的に AI コーディング環境に設定され、Claude Code、Cursor、OpenClaw で使用できるようになります

ソース: dawiddutoit/custom-claude。

Mocking is essential for unit testing, but over-mocking creates brittle tests that fail on refactoring. This skill provides a comprehensive framework for deciding what to mock, how to mock it safely, and when to use real objects instead.

Use when deciding what to mock in tests with "create mock", "mock external service", "AsyncMock pattern", or "what should I mock".

Do NOT use for domain testing (never mock domain objects), pytest configuration (use pytest-configuration), or test factories (use pytest-test-data-factories). Quick Start

pytest のマスター モック戦略: autospec=True と手動モックをいつ使用するか、非同期コードの AsyncMock パターン、モック ビルダーとファクトリー、絶対にモックしてはいけないもの。タイプセーフなモック作成パターンと、モックと実際のオブジェクトの決定マトリックスが含まれています。 使用場面: モック化された依存関係を含む単体テストの作成、モック化するか実際のオブジェクトを使用するかの決定、テスト分離の設定、外部サービス境界を使用したユース ケースのテスト、または再利用可能なモック ファクトリの構築。 ソース: dawiddutoit/custom-claude。

引用可能な情報

AI/検索での引用用の安定したフィールドとコマンド。

インストールコマンド
npx skills add https://github.com/dawiddutoit/custom-claude --skill pytest-mocking-strategy
カテゴリ
</>開発ツール
認証済み
初回登録
2026-02-25
更新日
2026-03-11

Browse more skills from dawiddutoit/custom-claude

クイックアンサー

pytest-mocking-strategy とは?

pytest のマスター モック戦略: autospec=True と手動モックをいつ使用するか、非同期コードの AsyncMock パターン、モック ビルダーとファクトリー、絶対にモックしてはいけないもの。タイプセーフなモック作成パターンと、モックと実際のオブジェクトの決定マトリックスが含まれています。 使用場面: モック化された依存関係を含む単体テストの作成、モック化するか実際のオブジェクトを使用するかの決定、テスト分離の設定、外部サービス境界を使用したユース ケースのテスト、または再利用可能なモック ファクトリの構築。 ソース: dawiddutoit/custom-claude。

pytest-mocking-strategy のインストール方法は?

ターミナルまたはコマンドラインツール(Terminal、iTerm、Windows Terminal など)を開きます このコマンドをコピーして実行します: npx skills add https://github.com/dawiddutoit/custom-claude --skill pytest-mocking-strategy インストール後、スキルは自動的に AI コーディング環境に設定され、Claude Code、Cursor、OpenClaw で使用できるようになります

ソースリポジトリはどこですか?

https://github.com/dawiddutoit/custom-claude