pytest-testing-assistant

Create focused pytest tests for individual functions with arrange-act-assert structure.

109|40|Updated Jul 24, 2017
One-click install
npx skills add https://github.com/dmitriiweb/extract-emails --skill pytest-testing-assistant
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pytest-testing-assistant
Source: https://github.com/dmitriiweb/extract-emails/tree/main/.codex/skills/pytest-testing-assistant
Command: npx skills add https://github.com/dmitriiweb/extract-emails --skill pytest-testing-assistant

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This skill helps developers write focused pytest tests as standalone functions, avoiding test classes and promoting clear, isolated validation of individual behaviors.

Core Features & Use Cases

  • Single-function tests: Draft tests as individual functions named test_<behavior> to improve readability and isolation.
  • Clear naming conventions: Use descriptive names like test_<function>_<behavior> to communicate intent.
  • Guided workflow: Follow arrange-act-assert structure and use fixtures sparingly to maintain simplicity.
  • Reference rules: See references/pytest_rules.md for detailed guidelines.

Quick Start

Create a test as def test_example(): and run pytest to execute it.

Frequently Asked Questions about pytest-testing-assistant

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

FAQPage Schema
How do I write standalone pytest tests for individual functions?

Write standalone pytest tests as individual functions named test_<behavior> to verify specific function behaviors. Structure each test using the arrange-act-assert workflow to maintain clear isolation and readability.

What naming convention should I use for pytest unit tests?

Use descriptive naming conventions like test_<function>_<behavior> for your pytest unit tests. This naming pattern communicates the test's intent clearly and improves readability when validating isolated function-level behaviors.

Should I use test classes or standalone functions in pytest?

Use standalone functions instead of test classes in pytest to promote clear, isolated validation of individual behaviors. Draft tests as individual functions to avoid unnecessary class structures and improve overall test readability.

How do I use fixtures in pytest to minimize boilerplate?

Use fixtures sparingly in pytest to minimize boilerplate while maintaining simplicity in your tests. Incorporate fixtures within the arrange-act-assert workflow to set up test conditions without duplicating setup code across standalone test functions.

Does this pytest testing approach work for isolated function-level testing?

Yes, this pytest testing approach is designed specifically for Python projects that require isolated function-level testing. It applies clear naming conventions and a simple arrange-act-assert workflow to verify individual function behaviors effectively.

What is the arrange-act-assert workflow for pytest test design?

The arrange-act-assert workflow for pytest test design structures tests into three phases: arranging necessary preconditions and fixtures, acting by executing the targeted function, and asserting the expected behavior. This maintains simplicity and clear validation.