Automatically choose the right polyfactory.
Project description
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")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
unifactory-0.1.0.tar.gz
(2.7 kB
view details)
Built Distribution
File details
Details for the file unifactory-0.1.0.tar.gz
.
File metadata
- Download URL: unifactory-0.1.0.tar.gz
- Upload date:
- Size: 2.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.12.1 Darwin/23.1.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
0bb7b7874fe6368fdc4302d805263a3fa423e046196a71433e4cb9e381380cc6
|
|
MD5 |
f316a8a0f0e29fcf5c66fb583c0ff575
|
|
BLAKE2b-256 |
fba347a749e72f5896622275d4ea29e45b9253729e8c7fb0a5dd5b04ce918570
|
File details
Details for the file unifactory-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: unifactory-0.1.0-py3-none-any.whl
- Upload date:
- Size: 2.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.12.1 Darwin/23.1.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
51db23016684c286df6790614ade56018c634bef485c822e878c74f8229f5891
|
|
MD5 |
9238d12a9728fbe7d5241ed0b0b3082c
|
|
BLAKE2b-256 |
a1ae8a9f063cc9703b1413fbf344ecc5d0f80c57515884e932ca327082fcd87a
|