Skip to content

test(bootstrapper): fix caplog assertion that depends on global pytes…#1164

Merged
mergify[bot] merged 1 commit into
python-wheel-build:mainfrom
shifa-khan:1092
May 20, 2026
Merged

test(bootstrapper): fix caplog assertion that depends on global pytes…#1164
mergify[bot] merged 1 commit into
python-wheel-build:mainfrom
shifa-khan:1092

Conversation

@shifa-khan
Copy link
Copy Markdown
Contributor

@shifa-khan shifa-khan commented May 19, 2026

Use caplog.at_level(logging.INFO) for the bootstrapper logger so the test doesn't rely on --log-level DEBUG being passed by the runner.

Closes: #1092

…t --log-level

Use caplog.at_level(logging.INFO) for the bootstrapper logger so the test doesn't rely on --log-level DEBUG being passed by the runner.

Closes: python-wheel-build#1092
Signed-off-by: Shifa Khan <shikhan@redhat.com>
@shifa-khan shifa-khan requested a review from a team as a code owner May 19, 2026 20:25
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 19, 2026

Review Change Stack

📝 Walkthrough

Walkthrough

This PR fixes a test flakiness issue in test_cache_lookup_resolver_exception_logs_info by making log-level assertions self-contained. The test previously relied on a global pytest --log-level DEBUG flag to capture INFO-level logs. The change adds import logging and wraps the test's resolver call with caplog.at_level(logging.INFO, logger="fromager.bootstrapper"), ensuring the test explicitly requests the log level it needs rather than depending on runner-wide configuration.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: fixing a caplog assertion that depends on global pytest log-level configuration.
Linked Issues check ✅ Passed The PR fully addresses issue #1092 by implementing the proposed solution: using caplog.at_level(logging.INFO, logger="fromager.bootstrapper") to make the test self-contained.
Out of Scope Changes check ✅ Passed All changes are directly related to fixing the test dependency on global pytest log-level; no extraneous modifications are present.
Description check ✅ Passed The pull request description clearly relates to the changeset, explaining the specific fix of using caplog.at_level(logging.INFO) to make the test self-contained.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@mergify mergify Bot added the ci label May 19, 2026
Copy link
Copy Markdown
Contributor

@rd4398 rd4398 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mergify mergify Bot merged commit 38c0758 into python-wheel-build:main May 20, 2026
39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tests: caplog assertion depends on global pytest --log-level

2 participants