-
Notifications
You must be signed in to change notification settings - Fork 418
Open
Description
Hi!
I've been facing some issues with a test suite that makes use of Starlette's TestClient, which is also used by FastAPI.
Important note, I'm using pytest with pytest-recording.
There are 2 types of issues I see, and both are random and not easily reproducible:
- cassettes are sometimes not recorded when running the full test suite but are when running the test alone.
- tests are failing when running test2, and trying to access the cassette in test2, while test2 is not even using
use_cassette... This mostly happens in parametrized tests but I'm not sure this is the "key" reason.
I think the problem mostly comes from the fact that the TestClient starts an async loop behind the scene which seems to hit the thread safety problem described here: #295, do you think it is indeed related?
Thanks for you time and for the otherwise very useful project 😃
adelevie, aromanovich and richardknudsen
Metadata
Metadata
Assignees
Labels
No labels