pytest-skill

Automate pytest test creation with fixtures, parametrize, markers, mocking, and conftest patterns.

Updated Apr 21, 2023
One-click install
npx skills add https://github.com/tuliosouza99/CartolaPy --skill pytest-skill-tuliosouza99
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pytest-skill
Source: https://github.com/tuliosouza99/CartolaPy/tree/main/.agents/skills/pytest-skill
Command: npx skills add https://github.com/tuliosouza99/CartolaPy --skill pytest-skill-tuliosouza99

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Automates the creation of robust, production-grade pytest tests by providing fixtures, parametrize, markers, mocking, and conftest patterns, reducing boilerplate and improving test quality.

Core Features & Use Cases

  • Fixtures: reusable setup and teardown you can share across tests.
  • Parametrize & Markers: data-driven tests and test categorization for scalable test suites.
  • Mocking & Conftest: streamlined mocking patterns and centralized fixtures for consistent testing.
  • Use Case: rapidly scaffold comprehensive test suites for Python modules with minimal boilerplate.

Quick Start

Run pytest to execute the provided test suite against your project.

Frequently Asked Questions about pytest-skill

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

FAQPage Schema
How do I auto-generate pytest tests for my Python project?

You can auto-generate pytest tests by leveraging automated test creation patterns that target fixtures, parametrize, markers, mocking, and conftest files. This approach reduces boilerplate and enforces best practices for comprehensive Python test suites.

What is the best way to structure pytest fixtures and conftest for scalable test suites?

The best way to structure pytest fixtures and conftest is to centralize reusable setup and teardown logic. Using conftest patterns allows you to share fixtures across modules consistently, minimizing boilerplate while maintaining scalable test architecture.

Can I use parametrize and markers for data-driven pytest tests?

Yes, automated pytest test generation supports data-driven testing by implementing the parametrize decorator. It automatically structures parametrized test cases to run multiple input scenarios, ensuring comprehensive test coverage across your Python codebase.

Does automated pytest generation handle mocking for Python modules?

Automated pytest generation handles mocking by providing streamlined mocking patterns within the test suite. It integrates mocks directly with your fixtures and conftest setup to isolate modules and ensure consistent testing behavior.

Why use conftest patterns when generating pytest test suites?

Using conftest patterns when generating pytest test suites allows you to centralize shared fixtures across multiple test modules. This eliminates repetitive setup boilerplate and enforces consistent testing environments throughout your Python project.