python-tests-skill

Guide Python unit and integration tests with pytest structure and markers.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/ialae/TelegarmBotor --skill python-tests-skill
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: python-tests-skill
Source: https://github.com/ialae/TelegarmBotor/tree/main/.github/skills/python-tests-skill
Command: npx skills add https://github.com/ialae/TelegarmBotor --skill python-tests-skill

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This guide helps developers write consistent, coherent, and effective Python unit and integration tests using pytest, reducing flaky tests and speeding up feedback loops.

Core Features & Use Cases

  • Clear test structure: unified layout for unit and integration tests under a single tests/ tree.
  • Naming conventions: descriptive test names that read as sentences and concise test modules.
  • Fixtures and conftest: reusable setup with proper scoping to keep tests fast and isolated.
  • Mocking and patches: guidance to mock at boundaries without over-mocking and to use autospec.
  • Parametrization: systematic coverage of input variations and edge cases.
  • Test discovery, organization, and markers: explicit separation of unit vs integration tests and proper labeling.

Quick Start

Run pytest from the project root to execute the full test suite (unit and integration) in one command.

Frequently Asked Questions about python-tests-skill

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

FAQPage Schema
How do I structure unit and integration tests in a Python project using pytest?

Structure unit and integration tests under a unified tests/ tree using pytest, separating them via explicit markers. This layout enables a single-command workflow to execute the full test suite from the project root.

What is the best way to manage reusable setup in pytest without slowing down test execution?

Manage reusable setup in pytest using fixtures and conftest files with proper scoping. This approach keeps tests fast and isolated by ensuring setup logic executes only when necessary across test modules.

How does mocking at boundaries work to avoid over-mocking in Python unit tests?

Mocking at boundaries isolates external dependencies without over-mocking internal logic by using autospec. This ensures mocks match the actual interface signatures, preventing drift and maintaining test reliability.

Can I run both unit and integration tests with a single pytest command?

Yes, you can run both unit and integration tests with a single pytest command from the project root. The Skill enforces a unified workflow with explicit markers to separate test types while executing the full suite together.

How do I parametrize Python tests to cover edge cases systematically?

Parametrize Python tests using the pytest parametrize decorator to systematically cover input variations and edge cases. This generates distinct test cases from a single test function, ensuring broad coverage without code duplication.

Why should I use descriptive naming conventions for pytest test modules and functions?

Use descriptive naming conventions for pytest test modules and functions so test names read as sentences. This clarifies test intent, simplifies debugging, and enforces concise test modules across the project.