Bỏ qua tới nội dung
TakoAPI
Quay lại kỹ năng

neo-py-test-creator

bởi martinforsulu

Communication
—Chưa có đánh giá
Đánh giá của bạn

Tóm tắt

Automatically generates pytest-compatible unit test templates from Python function signatures and docstrings.

Mô tả

Kỹ năng này làm gì

Generates pytest unit test templates from Python function signatures, type hints, and docstrings. Takes a Python file or code snippet and outputs a structured test file with edge case coverage and parametrized tests.

Writing test scaffolding by hand is repetitive; this skill derives test structure directly from the source code's own type annotations and docstrings.

Khi nào nên dùng

  • Scaffolding tests for a new utility module
  • Generating test stubs before a code review
  • Covering edge cases for functions with complex type hints
  • Bootstrapping a test suite for legacy Python code
  • Creating parametrized tests from docstring examples

Quy trình ví dụ

ĐẦU VÀO

User asks: Generate pytest tests for my utils.py file

AGENT
  1. 1

    Reads the target Python file or code snippet

  2. 2

    Parses function signatures, type hints, and docstrings using AST

  3. 3

    Identifies edge cases based on parameter types and default values

  4. 4

    Generates pytest-compatible test functions with assertions and docstrings

  5. 5

    Writes the output to test_utils.py with correct imports and structure

ĐẦU RA

A test_utils.py file containing pytest functions covering basic cases, boundary values, None inputs, and type edge cases for each function in utils.py

Cài đặt

clawhub install martinforsulu/neo-py-test-creator

Chạy lệnh CLI, hoặc dán prompt vào Claude Code, Cursor, Codex hay coding agent bạn đang dùng.

Liên kết