Skip to content

Latest commit

 

History

History
27 lines (20 loc) · 710 Bytes

README.md

File metadata and controls

27 lines (20 loc) · 710 Bytes

Unifactory

Unifactory is a spin off from fastapi-overrider. A simple tool to automatically choose a matching factory from polyfactory's inventory.

Installation

pip install unifactory

Examples

from polyfactory.pytest_plugin import register_fixture
from unifactory import unifactory, build, batch, coverage

@dataclass
class Person:
    name: str
    age: float
    height: float
    weight: float

some_person = build(Person)
five_persons = batch(Person, 5)
all_persons = coverage(Person)
person_factory = register_fixture(unifactory(Person), name="person_factory")