Only import blockbuster if we will actually use it #11363
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This makes blockbuster an actually optional test dependency, as suggested in cbornet/blockbuster#46 (comment), assuming the
skip_blockbustermark is set when the dependency is unavailable.What do these changes do?
Only import the
blockbustermodule inside theblockbusterfixture, rather than at the top level oftests/conftest.py, and even then, only after we have ruled out the cases in which it would not actually be used.The result is that the
blockbustermodule is never imported at all when theskip_blockbustermark is set; 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-aiohttpbut we would rather avoid packagingpython-blockbusterand its dependencypython-forbiddenfruitif possible – see cbornet/blockbuster#46 for context. It is likely to be useful for other distribution packagers as well.Are there changes in behavior for the user?
No, only for people running the tests under certain conditions.
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.txtaiohttp/CONTRIBUTORS.txt
Line 62 in f42b73a
CHANGES/folder