test-generator
pytestテストのボイラープレートを生成
Également disponible depuis: CuriousLearner
一からテストを書くには時間がかかり、プロジェクトの規約に従う必要があります。このスキルは、適切なAAAパターン、型ヒント、パラメータ化されたテストケースを含む包括的なテストテンプレートをプロジェクトの標準に合わせて自動生成します。
Télécharger le ZIP du skill
Importer dans Claude
Allez dans Paramètres → Capacités → Skills → Importer un skill
Activez et commencez à utiliser
Tester
Utilisation de "test-generator". generate tests for src/utils.py - function format_name(first: str, last: str) -> str
Résultat attendu:
- Created: tests/test_utils.py
- Test class: TestFormatName
- Test cases: basic, valid input, invalid input, edge cases
- All tests follow AAA pattern with type hints
- Review TODO comments and add actual test data
Utilisation de "test-generator". generate pytest fixture for database connection
Résultat attendu:
- Created: conftest.py entry
- Fixture name: db_connection
- Provides Generator[Database, None, None] with proper setup and teardown
- Add initialization parameters and cleanup logic
Audit de sécurité
SûrThis is a pure documentation skill containing only SKILL.md with usage instructions and 5 Jinja2-style templates for pytest test generation. No executable scripts, network calls, or file writes exist. All static findings are false positives: template variables like {module_name} were misidentified as cryptographic algorithms, markdown code block backticks were misidentified as shell execution, and documentation instructions like 'Read the source file' were misidentified as system reconnaissance.
Facteurs de risque
🌐 Accès réseau (1)
📁 Accès au système de fichiers (1)
⚙️ Commandes externes (59)
Score de qualité
Ce que vous pouvez construire
新しいTDDプロジェクトを開始
新しい関数やクラスを実装する前にテストテンプレートを生成します
テスト標準を適用
チームリポジトリ間で一貫したテストパターンを作成します
テストカバレッジを構築
パラメータ化されたテストとエッジケースのテンプレートでテストファイルを迅速にスキャフォールディングします
Essayez ces prompts
generate tests for src/my_project/utils.py - function calculate_total(items: list[float]) -> float
generate tests for UserManager class with create_user and delete_user methods
generate async tests for fetch_user_data(user_id: str) -> dict function
generate parametrized tests for validate_email function with various valid and invalid email formats
Bonnes pratiques
- 生成されたテストを即座に実行して失敗することを確認します(TDDのレッドフェーズ)
- すべてのTODOコメントを実際のテストデータに置き換えてから実装します
- カバレッジを最大化するために複数の入力組み合わせにパラメータ化されたテストを使用します
Éviter
- 内部関数やバリデーターをモックすることは避け、可能な限り実際のコードを使用します
- 1つの関数で複数の無関係な動作をテストするテストは書かないでください
- 過度なモッキングを避け、HTTP、データベース、ファイルI/O、時間、ランダム値のみをモックします