-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Disable the blockbuster fixture when the module is not importable #11367
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
Disable the blockbuster fixture when the module is not importable #11367
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #11367 +/- ##
=======================================
Coverage 98.75% 98.75%
=======================================
Files 129 129
Lines 43416 43418 +2
Branches 2325 2325
=======================================
+ Hits 42877 42879 +2
Misses 384 384
Partials 155 155
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
CodSpeed Performance ReportMerging #11367 will not alter performanceComparing Summary
|
This makes blockbuster an *actually optional* test dependency; see cbornet/blockbuster#46 (comment).
66acd29
to
18a77cc
Compare
Implemented suggestions, rebased on |
Backport to 3.13: 💚 backport PR created✅ Backport PR branch: Backported as #11402 🤖 @patchback |
…hen the module is not importable (#11402) **This is a backport of PR #11367 as merged into master (cccbf4c).** Co-authored-by: Ben Beasley <[email protected]>
What do these changes do?
This makes blockbuster an actually optional test dependency; see cbornet/blockbuster#46 (comment).
Try to import the
blockbuster
module intests/conftest.py
; if it succeeds, disableautouse
for the blockbuster fixture, and if it does end up getting used on a test, skip it in the same manner currently used for tests decorated with@pytest.mark.skip_blockbuster
.The result is that the tests can still run when the
blockbuster
module is not available in the environment; before, it was unconditionally imported no matter what, so it wasn’t really an optional test dependency in practice.This is useful in Fedora, where we package
python-aiohttp
but we would rather avoid packagingpython-blockbuster
and its dependencypython-forbiddenfruit
if possible – see cbornet/blockbuster#46 for context. It is likely to be useful for other distribution packagers as well.This PR replaces #11363, which was based on incomplete understanding.
Are there changes in behavior for the user?
No, only for people running the tests without installing all of the declared test dependencies.
Is it a substantial burden for the maintainers to support this?
It should be no burden at all.
Related issue number
N/A
Checklist
CONTRIBUTORS.txt
aiohttp/CONTRIBUTORS.txt
Line 62 in f42b73a
CHANGES/
folder