Skip to content
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

docs: add tip about pytest-asyncio fixture and mark.anyio #26

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

baggiponte
Copy link

Ciao! Finally had time to write the PR for #25 😊

Feel free to reword as you wish. I tried to make more explicit the fact that, if your app has a lifespan, you need to use asgi-lifespan.

Comment on lines +212 to +214
## 6. Use `pytest-asyncio` fixtures to test your FastAPI and ASGI applications

When writing fixtures for your FastAPI applications, you should use [pytest-asyncio](pytest-asyncio) to define fixtures. Besides, if your application has a lifespan, you should use [`asgi-lifespan`](asgi-lifespan) to run the lifespan events.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's not really my recommendation... 🤔

I recommend using anyio because you already have the dependency.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And the asgi-lifespan is mentioned above, no need to mention twice.

@Kludex
Copy link
Owner

Kludex commented Nov 29, 2024

@baggiponte Do you have time to address my comments?

@baggiponte
Copy link
Author

Ciao @Kludex , sorry for the late reply. Wanted to address them sooner but I'm a bit tight. If you can't wait a bit more you (anyone else?) can go on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants