refactor: removed capture_log#6739
Open
semohr wants to merge 7 commits into
Open
Conversation
AutotagImportTestCase` is not needed: pretend mode skips autotagging entirely (`session.py:201`: `if pretend -> log_files` bypasses `lookup_candidates`).
|
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. |
Codecov Report✅ All modified and coverable lines are covered by tests. 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:
|
Contributor
There was a problem hiding this comment.
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 tocaplogintest_loggingandtest_importer - refactor pretend-import tests to pytest-style helper +
caplog - remove
capture_logcontext manager frombeets/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 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 |
f962543 to
e1d0ddd
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request remove the last remnants of the
capture_logcontext-manager used previously in the testing module.This touches:
test_loggingtest_importerTODOs:
ChangelogNot 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