Skip to content

refactor: removed capture_log#6739

Open
semohr wants to merge 7 commits into
masterfrom
capture_log_removed
Open

refactor: removed capture_log#6739
semohr wants to merge 7 commits into
masterfrom
capture_log_removed

Conversation

@semohr

@semohr semohr commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

This pull request remove the last remnants of the capture_log context-manager used previously in the testing module.

This touches:

  • test_logging
  • test_importer

TODOs:

  • Changelog Not needed as this is an internal refactor only, will add an entry once all logging related changes are done.

This is related to the multi-step efforts to improve logging in beets #6553

semohr added 3 commits June 14, 2026 12:18
AutotagImportTestCase` is not needed: pretend mode skips autotagging
entirely (`session.py:201`: `if pretend -> log_files` bypasses
`lookup_candidates`).
Copilot AI review requested due to automatic review settings June 14, 2026 10:26
@semohr semohr requested a review from a team as a code owner June 14, 2026 10:26
@github-actions

Copy link
Copy Markdown

Thank you for the PR! The changelog has not been updated, so here is a friendly reminder to check if you need to add an entry.

@semohr semohr changed the title Capture log removed refactore: removed capture_log Jun 14, 2026
@codecov

codecov Bot commented Jun 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.52%. Comparing base (2337cfb) to head (e1d0ddd).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #6739   +/-   ##
=======================================
  Coverage   74.52%   74.52%           
=======================================
  Files         162      162           
  Lines       20818    20818           
  Branches     3295     3295           
=======================================
  Hits        15515    15515           
  Misses       4547     4547           
  Partials      756      756           
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

grug see PR try remove last capture_log bits from tests. move tests to pytest caplog so logging overhaul work easier later.

Changes:

  • swap helper.capture_log() use to caplog in test_logging and test_importer
  • refactor pretend-import tests to pytest-style helper + caplog
  • remove capture_log context manager from beets/test/helper.py

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
test/test_logging.py Replace capture_log usage with caplog for logging-level + threaded logging tests.
test/test_importer.py Replace capture_log usage with caplog and refactor pretend-import test class.
beets/test/helper.py Remove capture_log helper from test utilities.

Comment thread test/test_logging.py
Comment thread test/test_importer.py
Comment on lines +1735 to 1739
def _run(self, importer, caplog):
with caplog.at_level("DEBUG"):
importer.run()

assert len(self.lib.items()) == 0
assert len(self.lib.albums()) == 0
Comment thread beets/test/helper.py Outdated
@semohr semohr changed the title refactore: removed capture_log refactor: removed capture_log Jun 14, 2026
@semohr semohr force-pushed the capture_log_removed branch from f962543 to e1d0ddd Compare June 14, 2026 11:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants