-
-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(factories): added an ability to use the Coroutine as a factory field #641
base: main
Are you sure you want to change the base?
Conversation
…d conftest.py; added a test for using coroutine_field
Docs and updated examples look good I think this is a good feature to have but would have concerns about
For 1, would it be possible to resolve coroutine from sync code itself by running in a thread or suggesting this in docs? This avoids pain of maintaining both sync and async versions at the expense of correctness and general proper async behaviour. Something like
with above being used when a coroutine is found as a field. |
Summary
|
Documentation preview will be available shortly at https://litestar-org.github.io/polyfactory-docs-preview/641 |
The main thing is the ability to use a coroutine type field for more complex logic (for example, using existing data from the DB).
Description