pytest_plugin¶
- class polyfactory.pytest_plugin.FactoryFixture[source]¶
Bases:
object
Decorator that creates a pytest fixture from a factory
- polyfactory.pytest_plugin.register_fixture(factory: None = None, *, scope: Scope = 'function', autouse: bool = False, name: str | None = None) FactoryFixture [source]¶
- polyfactory.pytest_plugin.register_fixture(factory: type[T], *, scope: Scope = 'function', autouse: bool = False, name: str | None = None) Callable[[], type[T]]
A decorator that allows registering model factories as fixtures.