-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Use async fixture in testing docs #8457
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #8457 +/- ##
=======================================
Coverage 97.64% 97.64%
=======================================
Files 107 107
Lines 33067 33067
Branches 3885 3885
=======================================
Hits 32288 32288
Misses 562 562
Partials 217 217
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
I think that injecting the P.S. I didn't know you could make async fixtures. Are they new? |
aiohttp_client depends on the loop fixture, so that's not something for the user to be concerned with.
We've been using them in various places for atleast a couple of years. So, probably supported since 2-5 years ago. |
I wonder why our tests get hit by this, then.. Anyway, I don't have anything against the patch in general. Just wanted to clarify this bit. |
Could you check what's the oldest pytest where this works? Perhaps it'd be nice to document if this doesn't work on something ancient. |
I think it's actually supported by pytest-asyncio (same as tests). Maybe our original code before using pytest-asyncio didn't support fixtures. It's not clear to me when exactly it became available (or if it even wasn't), but it seems unlikely people will encounter a problem. |
Backport to 3.9: 💚 backport PR created✅ Backport PR branch: Backported as #8460 🤖 @patchback |
(cherry picked from commit db1b912)
Backport to 3.10: 💚 backport PR created✅ Backport PR branch: Backported as #8461 🤖 @patchback |
(cherry picked from commit db1b912)
Instead of low-level asyncio APIs, which regular users shouldn't be using.