Skip to content

test(bootstrapper): fix caplog assertion that depends on global pytest --log-level - #1287

Merged
LalatenduMohanty merged 2 commits into
python-wheel-build:mainfrom
rd4398:fix/caplog-log-level-1274
Aug 6, 2026
Merged

test(bootstrapper): fix caplog assertion that depends on global pytest --log-level#1287
LalatenduMohanty merged 2 commits into
python-wheel-build:mainfrom
rd4398:fix/caplog-log-level-1274

Conversation

@rd4398

@rd4398 rd4398 commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

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

Also remove --log-level DEBUG from the hatch test runner command so that future tests that forget to set their own log level will fail in CI.

Closes: #1274

…t --log-level

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

Also remove `--log-level DEBUG` from the hatch test runner command so
that future tests that forget to set their own log level will fail in CI.

Co-Authored-By: Claude <claude@anthropic.com>
Closes: python-wheel-build#1274
Signed-off-by: Rohan Devasthale <rdevasth@redhat.com>
@rd4398
rd4398 requested a review from a team as a code owner August 5, 2026 13:00
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@rd4398, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 38 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: f0eccaee-d1a3-4486-8ff9-5343df715fc3

📥 Commits

Reviewing files that changed from the base of the PR and between eeb6f62 and b9de41c.

📒 Files selected for processing (1)
  • tests/test_constraints.py
📝 Walkthrough

Walkthrough

The Hatch test command no longer passes --log-level DEBUG to pytest. The constraint logging test imports logging and configures caplog to capture INFO-level messages from fromager.bootstrapper._prepare_source.

Estimated code review effort: 1 (Trivial) | ~5 minutes

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The changes satisfy issue #1274 by setting INFO-level capture explicitly and removing the global DEBUG log-level override.
Out of Scope Changes check ✅ Passed All changes are limited to the logging test and Hatch test-runner configuration required by issue #1274.
Title check ✅ Passed The title clearly identifies the bootstrapper test fix and its dependency on global pytest logging configuration.
Description check ✅ Passed The description accurately explains the logging assertion fix and removal of the global pytest log-level setting.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch

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.

@rd4398
rd4398 requested a review from smoparth August 5, 2026 13:01
@mergify mergify Bot added the ci label Aug 5, 2026
…tform.machine`

`packaging` 26.3 caches the result of `default_environment()` via
`@functools.cache`, so patching `platform.machine` after the first call
has no effect. Mock `markers.default_environment` directly to return a
fake environment with `platform_machine` set to `"atari"`.

Co-Authored-By: Claude <claude@anthropic.com>
Signed-off-by: Rohan Devasthale <rdevasth@redhat.com>
@LalatenduMohanty
LalatenduMohanty merged commit 925a19e into python-wheel-build:main Aug 6, 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.

[Bug]: test_constraint_logged_when_present fails unless --log-level=DEBUG is passed to pytest

4 participants