Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@musicinmybrain
Copy link
Contributor

@musicinmybrain musicinmybrain commented Jul 29, 2025

This makes blockbuster an actually optional test dependency, as suggested in cbornet/blockbuster#46 (comment), assuming the skip_blockbuster mark is set when the dependency is unavailable.

What do these changes do?

Only import the blockbuster module inside the blockbuster fixture, rather than at the top level of tests/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 blockbuster module is never imported at all when the skip_blockbuster mark 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-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.

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

  • 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

This makes blockbuster an *actually optional* test dependency, as
suggested in
cbornet/blockbuster#46 (comment),
assuming the `skip_blockbuster` mark is set when the dependency is
unavailable.
@musicinmybrain musicinmybrain requested a review from asvetlov as a code owner July 29, 2025 20:18
@psf-chronographer psf-chronographer bot added the bot:chronographer:provided There is a change note present in this PR label Jul 29, 2025
@codspeed-hq
Copy link

codspeed-hq bot commented Jul 29, 2025

CodSpeed Performance Report

Merging #11363 will not alter performance

Comparing musicinmybrain:optional-blockbuster (5b49235) with master (2a117d4)1

Summary

✅ 59 untouched benchmarks

Footnotes

  1. No successful run was found on master (f42b73a) during the generation of this report, so 2a117d4 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@musicinmybrain
Copy link
Contributor Author

Hmm. I have misunderstood the use of the skip_blockbuster mark. I am not sure that this PR will be useful as-is. I may open an alternative version later if I figure out the details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

1 participant