What problem does it solve?
This Skill eliminates the tedious, error-prone work of manually writing test fixtures for Litestar application models, ensuring generated mock data always passes validation constraints without custom per-test setup.
Core Features & Use Cases
- Multi-backend mock data generation: Auto-generates validation-passing instances for Pydantic, msgspec, dataclass, attrs, TypedDict, and SQLAlchemy models used in Litestar projects, respecting all model constraints and validators.
- Native pytest integration: Registers factories as pytest fixtures with a single decorator, removing boilerplate fixture code and making factories available across test files.
- Litestar-specific workflow guidance: Includes pre-built patterns for handler payload testing, ORM model fixture creation, SAQ task payload generation, and Channels event system tests tailored to the Litestar ecosystem.
- Use Case: When testing a Litestar order creation endpoint that accepts a msgspec DTO, use this Skill to auto-generate valid request payloads and wire nested customer model data automatically instead of hand-coding test values.
Quick Start
Use the polyfactory skill to generate a valid mock msgspec DTO payload for your Litestar order creation endpoint test.