本文へスキップ
Skillpedia
テスト48k · #5553

python-testing-patterns

できること

このガイドは、Pythonコードを網羅的にテストする方法を解説します。「pytest」の使い方、「fixtures(フィクスチャ:事前に用意された準備処理)」の作成、「mocking(モッキング:コードの一部を模擬すること)」、テスト駆動開発(TDD)による進め方などを扱います。

使う場面

  • ✓Pythonコードのテストを書くとき。
  • ✓テストのまとまり(テストスイート)を設定し、整理するとき。
  • ✓TDDの手法に沿って開発を進めるとき。

スキルのリンク

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/python-testing-patterns/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/python-testing-patterns/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“リストの平均値を計算するPython関数のテストは、どのように書けばよいですか?”

毎週5つの新しいスキル。1分で読めます。

仕組み

AIはこのガイドを参考に、効率のよいPythonテストの書き方を示します。pytestのようなツールの使い方や、依存する部品を模擬する手法を説明し、コードが正しく動くことを確かめられるようにします。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

Python Testing Patterns

Comprehensive guide to implementing robust testing strategies in Python using pytest, fixtures, mocking, parameterization, and test-driven development practices.

Use this skill when

  • Writing unit tests for Python code
  • Setting up test suites and test infrastructure
  • Implementing test-driven development (TDD)
  • Creating integration tests for APIs and services
  • Mocking external dependencies and services
  • Testing async code and concurrent operations
  • Setting up continuous testing in CI/CD
  • Implementing property-based testing
  • Testing database operations
  • Debugging failing tests

Do not use this skill when

  • The task is unrelated to python testing patterns
  • You need a different domain or tool outside this scope

Instructions

  • Clarify goals, constraints, and required inputs.
  • Apply relevant best practices and validate outcomes.
  • Provide actionable steps and verification.
  • If detailed examples are required, open resources/implementation-playbook.md.

Resources

  • resources/implementation-playbook.md for detailed patterns and examples.

Limitations

  • Use this skill only when the task clearly matches the scope described above.
  • Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
  • Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
よくある質問

「pytest」とは何ですか?

Pythonコードのテストを書きやすくする、人気の高いツールです。

「fixtures」とは何ですか?

複数のテストで繰り返し使える、テスト環境を整えるための初期設定のことです。

「mocking」とは何ですか?

コードの一部や、コードが依存する外部サービスを模擬する技法です。これにより、個々の部品を単独で検証できます。

詳細

作者による元の説明

Implement comprehensive testing strategies with pytest, fixtures, mocking, and test-driven development. Use when writing Python tests, setting up test suites, or implementing testing best practices.

repo: sickn33/agentic-awesome-skills

人気

GitHubのスター
48k
ランキング
#5553
ライセンス
MIT
更新日
2026/10/15

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル