Skip to content

Conversation

musicinmybrain
Copy link
Contributor

What do these changes do?

This makes blockbuster an actually optional test dependency; see cbornet/blockbuster#46 (comment).

Try to import the blockbuster module in tests/conftest.py; if it succeeds, disable autouse 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 packaging python-blockbuster and its dependency python-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

  • I think the code is well written
  • Unit tests for the changes exist N/A, the change is in test code
  • Documentation reflects the changes No documentation changes are required
  • If you provide code modification, please add yourself to CONTRIBUTORS.txt

Ben Beasley

  • Add a new news fragment into the CHANGES/ folder

Copy link

codecov bot commented Jul 30, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.75%. Comparing base (4263044) to head (706379a).
⚠️ Report is 1 commits behind head on master.

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           
Flag Coverage Δ
CI-GHA 98.64% <100.00%> (+<0.01%) ⬆️
OS-Linux 98.37% <100.00%> (+<0.01%) ⬆️
OS-Windows 96.80% <100.00%> (-0.01%) ⬇️
OS-macOS 97.68% <100.00%> (+<0.01%) ⬆️
Py-3.10.11 97.33% <100.00%> (+<0.01%) ⬆️
Py-3.10.18 97.72% <100.00%> (+<0.01%) ⬆️
Py-3.11.13 97.92% <100.00%> (+<0.01%) ⬆️
Py-3.11.9 97.52% <100.00%> (-0.01%) ⬇️
Py-3.12.10 97.62% <100.00%> (+<0.01%) ⬆️
Py-3.12.11 98.01% <100.00%> (+<0.01%) ⬆️
Py-3.13.5 98.27% <100.00%> (+<0.01%) ⬆️
Py-3.9.13 97.21% <100.00%> (+<0.01%) ⬆️
Py-3.9.23 97.61% <100.00%> (-0.01%) ⬇️
Py-pypy7.3.16 88.07% <100.00%> (-2.85%) ⬇️
VM-macos 97.68% <100.00%> (+<0.01%) ⬆️
VM-ubuntu 98.37% <100.00%> (+<0.01%) ⬆️
VM-windows 96.80% <100.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

codspeed-hq bot commented Jul 30, 2025

CodSpeed Performance Report

Merging #11367 will not alter performance

Comparing musicinmybrain:optional-blockbuster (706379a) with master (4263044)

Summary

✅ 59 untouched benchmarks

@musicinmybrain
Copy link
Contributor Author

Implemented suggestions, rebased on master, tidied up the commit history, and force-pushed.

@Dreamsorcerer Dreamsorcerer added the backport-3.13 Trigger automatic backporting to the 3.13 release branch by Patchback robot label Aug 9, 2025
@Dreamsorcerer Dreamsorcerer merged commit cccbf4c into aio-libs:master Aug 9, 2025
40 of 41 checks passed
Copy link
Contributor

patchback bot commented Aug 9, 2025

Backport to 3.13: 💚 backport PR created

✅ Backport PR branch: patchback/backports/3.13/cccbf4cd3390729afe6ebe4c1078c2c979016503/pr-11367

Backported as #11402

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

patchback bot pushed a commit that referenced this pull request Aug 9, 2025
Dreamsorcerer pushed a commit that referenced this pull request Aug 10, 2025
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-3.13 Trigger automatic backporting to the 3.13 release branch by Patchback robot bot:chronographer:provided There is a change note present in this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants