pytest-test-data-factories

Installation
SKILL.md

Pytest Test Data Factories

Purpose

Test data factories eliminate duplication and make tests more maintainable. Instead of recreating Order objects with the same fields in every test, factories provide sensible defaults and allow customization only where needed.

Quick Start

Create simple factory functions in conftest.py:

# tests/unit/conftest.py
import pytest
from datetime import datetime
from app.extraction.domain.entities import Order
from app.extraction.domain.value_objects import OrderId, Money, ProductTitle
Related skills
Installs
8
GitHub Stars
1
First Seen
Jan 23, 2026