test-generator

Generate pytest unit tests with mocks for Python source code.

12|3|Updated Jun 17, 2026
One-click install
npx skills add https://github.com/phuhao00/bony-agent --skill test-generator-phuhao00
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-generator
Source: https://github.com/phuhao00/bony-agent/tree/main/.agent/skills/test-generator
Command: npx skills add https://github.com/phuhao00/bony-agent --skill test-generator-phuhao00

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pytest, unittest.

What problem does it solve?

This Skill addresses the time-consuming nature of writing boilerplate unit tests, ensuring your codebase remains reliable and regression-free with minimal manual effort.

Core Features & Use Cases

  • Automated Test Generation: Creates comprehensive pytest suites including success, failure, and edge-case scenarios.
  • Mocking Support: Automatically generates mocks for external clients like ZhipuAI and Langchain tools.
  • Use Case: When you finish writing a new utility function, invoke this skill to instantly generate a robust test file that covers happy paths and error handling.

Quick Start

Use the test-generator skill to create a comprehensive pytest suite for the file located at tools/my_tool.py.

Frequently Asked Questions about test-generator

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

FAQPage Schema
How do I automate pytest unit test generation for Python source code?

To automate pytest unit test generation, you can use a generation tool that analyzes your Python source code and creates structured test cases covering success paths, failure modes, and edge cases. This eliminates manual boilerplate writing.

Can I automatically generate mocks for external API clients and file I/O operations in pytest?

Yes, automated test generation can create mocks for external API clients and file I/O operations. It structures these mocks within the pytest framework to isolate code behavior and ensure reliable testing without live dependencies.

What is the best way to cover edge cases and failure modes when writing unit tests?

The best way to cover edge cases and failure modes is through automated test generation that structures comprehensive pytest suites. It systematically builds scenarios for both happy paths and error handling, ensuring robust software quality assurance.

Do I need pytest and unittest installed to generate comprehensive Python test suites?

Yes, you need pytest and unittest installed in your environment. The test generator relies on these frameworks as dependencies to output structured test cases, ensuring the generated code aligns with standard Python testing practices.

How does automated mocking work for tools like ZhipuAI and Langchain in unit tests?

Automated mocking for tools like ZhipuAI and Langchain works by generating mock objects that simulate their external client behaviors. This allows the generated pytest suite to test your code's interaction logic without making actual API calls.

Why write boilerplate unit tests manually when refactoring Python code?

Writing boilerplate unit tests manually during refactoring is time-consuming and prone to oversight. Automated test generation instantly produces regression-free pytest suites, ensuring code reliability with minimal manual effort while you focus on logic changes.