testing-python

Generate and repair Python tests from story specifications with pytest conventions.

1|Updated Jan 6, 2026
One-click install
npx skills add https://github.com/simonheimlicher/spx-claude --skill testing-python-simonheimlicher
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testing-python
Source: https://github.com/simonheimlicher/spx-claude/tree/main/plugins/python/skills/testing-python
Command: npx skills add https://github.com/simonheimlicher/spx-claude --skill testing-python-simonheimlicher

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps teams write and fix Python tests for a story specification, reducing manual test authoring time and improving test coverage.

Core Features & Use Cases

  • Generate new Python tests directly from a story spec.
  • Fix tests based on reviewer feedback, preserving test intent and style.
  • Enforce best practices: explicit typing, pytest structure, named constants, and DI-friendly patterns.

Quick Start

Input: Story spec path, e.g., spx/01-capability/02-feature/21-story.story/. Output: Test files written to {story}/tests/. Workflow: Check mode (WRITE or FIX) → Execute → Verify → Report.

Frequently Asked Questions about testing-python

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

FAQPage Schema
How do I generate Python tests from a story spec automatically?

You can generate Python tests from a story spec by providing the story spec path, which triggers automated test creation under the story's tests directory using pytest conventions and explicit typing. The skill writes test files directly to the specified output folder.

Can I fix existing pytest test files based on reviewer feedback?

Yes, you can fix existing pytest test files using the FIX mode, which applies reviewer feedback while preserving the original test intent and style. It enforces typing and dependency-injection friendly patterns during the repair process.

What is the best way to enforce typing and pytest conventions in generated Python tests?

The best way to enforce typing and pytest conventions is to automate test generation from a story spec, which inherently applies explicit typing, named constants, and DI-friendly patterns. This ensures all newly created or repaired tests meet strict structural standards.

Does automated Python test generation work with dependency-injection friendly patterns?

Yes, automated Python test generation explicitly supports dependency-injection friendly patterns alongside pytest structure and type hints. This ensures the generated tests are modular, maintainable, and compatible with modern dependency injection frameworks.

How do I structure pytest test files for a specific story specification?

To structure pytest test files for a story specification, input the spec path to automatically generate tests with appropriate level markers under the story's tests directory. The generated files follow standardized pytest conventions and typing rules.

Why should I use automated test generation instead of manually writing pytest tests?

You should use automated test generation to reduce manual authoring time and improve test coverage by directly translating story specifications into pytest files. It guarantees consistent typing, named constants, and DI-friendly patterns across all generated tests.