tool-testing

Write pytest tests for Tool Master tools with mocking, fixtures, and async patterns.

1|Updated Dec 16, 2025
One-click install
npx skills add https://github.com/dangerpotter/tool_master --skill tool-testing
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tool-testing
Source: https://github.com/dangerpotter/tool_master/tree/main/.claude/skills/tool-testing
Command: npx skills add https://github.com/dangerpotter/tool_master --skill tool-testing

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps developers and QA engineers write, maintain, and improve tests for Tool Master tools. It covers mocking, fixtures, and async test patterns, reducing flaky tests and speeding up validation.

Core Features & Use Cases

  • Test scaffolding: Generate consistent test structures for Tool Master tools.
  • Mocking & fixtures: Show how to mock HTTP calls, environment variables, and external dependencies.
  • Async testing patterns: Demonstrates asyncio-friendly tests with pytest.mark.asyncio.
  • Use Case: When adding tests to a new or existing tool, this skill provides templates and best practices.

Quick Start

Create a basic test module under tests/test_<tool>_tools.py with a simple test for a tool, then run pytest to verify.

Frequently Asked Questions about tool-testing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write pytest tests for Tool Master tools?

Write pytest tests by creating a test module under tests/test_<tool>_tools.py with test functions that verify tool metadata and execution results. Use pytest fixtures and mocking to isolate dependencies, then run pytest to validate your test suite.

How do I mock external dependencies in pytest tests?

Pytest fixtures let you mock HTTP calls, environment variables, and external dependencies. Define fixtures that return mock objects, inject them into test functions, and verify tool behavior without calling live services.

Can I test async Tool Master tools with pytest?

Yes. Use pytest.mark.asyncio to write asyncio-friendly tests for asynchronous tools. This decorator enables pytest to handle async test functions and fixtures while maintaining the same mocking and validation patterns.

What should pytest tests verify for Tool Master tools?

Tests should verify tool metadata accuracy, validate execution results against expected outputs, confirm proper error handling in both sync and async contexts, and ensure mocks and fixtures function correctly across different tool interactions.

Does pytest reduce flaky tests when testing Tool Master tools?

Yes. Pytest fixtures and mocking eliminate external service dependencies that cause flakiness. By controlling inputs and isolating components, you create deterministic tests that run consistently and speed up validation cycles.

What's the best way to improve test coverage for existing Tool Master tools?

Apply pytest-based templates that enforce consistent test structure, add fixtures to cover edge cases, mock failure scenarios, and validate error handling. This systematic approach fills coverage gaps and catches regressions.