Skip to content

refactor: Pytest based setup for test_plugins#6659

Draft
semohr wants to merge 28 commits into
masterfrom
pytest_for_test_plugins
Draft

refactor: Pytest based setup for test_plugins#6659
semohr wants to merge 28 commits into
masterfrom
pytest_for_test_plugins

Conversation

@semohr
Copy link
Copy Markdown
Contributor

@semohr semohr commented May 20, 2026

This PR is a minor refactor of test/test_plugins.py and replaces the unitest test cases with a pytest setup. Also replaced capture_log with caplog fixture.

Needs rebasing after #6658 is merged.

TODOs:

  • Changelog Not needed as this is an internal refactor only

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

@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.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.44%. Comparing base (2adabcd) to head (88b9ca9).
⚠️ Report is 27 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6659      +/-   ##
==========================================
- Coverage   72.65%   72.44%   -0.21%     
==========================================
  Files         161      161              
  Lines       20710    20710              
  Branches     3276     3276              
==========================================
- Hits        15047    15004      -43     
- Misses       4934     4980      +46     
+ Partials      729      726       -3     

see 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

semohr added 27 commits May 21, 2026 16:54
AlbumArtOperationConfigurationTest -> TestAlbumArtOperationConfiguration
- moved setup into proper pytest fixtures for seperation
EnforceRatioConfigTest -> TestEnforceRatioConfig
are now provided by the imageResponseMocker. Also fixed indenting of
json blocks.
image_response_mocker instead of class inheritance. Aligns more
with pytest imo
use the new image_response_mocker and pytest setup
- Renamed image_response_mocker to image_request_mock
- Use requests_mock.mocker.Mocker instead of responses.RequestsMock
- Renamed function add to get
@semohr semohr force-pushed the pytest_for_test_plugins branch from a729a97 to 88b9ca9 Compare May 21, 2026 14:58
@snejus
Copy link
Copy Markdown
Member

snejus commented May 21, 2026

minor refactor

image

😆

@semohr
Copy link
Copy Markdown
Contributor Author

semohr commented May 21, 2026

It looks like I forgot to rebase it :D Only the last commit is relevant.

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