tests: replace function-scoped helper fixtures with TestHelper#6709
Open
snejus wants to merge 6 commits into
Open
tests: replace function-scoped helper fixtures with TestHelper#6709snejus wants to merge 6 commits into
snejus wants to merge 6 commits into
Conversation
|
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. |
❌ 1 Tests Failed:
View the top 1 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
Contributor
There was a problem hiding this comment.
Pull request overview
grug see PR make test setup less copy-paste. instead of local helper fixtures per file, tests now inherit shared helper classes (TestHelper/PluginTestHelper) and migration tests get one common harness.
Changes:
- swap function-scoped
helperfixtures for TestHelper / PluginTestHelper base classes in plugin tests - add
MigrationTestHelperharness so each migration test only defines legacy setup + migration under test - adjust playcount tests to use class-based helper + explicit
logfixture injection
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| test/plugins/utils/test_playcount.py | move from helper fixture to TestHelper inheritance; pass logger via fixture |
| test/plugins/test_missing.py | use shared PluginTestHelper (plus IO mixin) for missing plugin CLI tests |
| test/plugins/test_fuzzy.py | use PluginTestHelper for fuzzy plugin tests; remove local helper fixture |
| test/library/test_migrations.py | introduce MigrationTestHelper and refactor migrations tests onto shared harness |
- Replace local setup fixtures with existing test helper base classes to reduce duplicated test setup.
- Centralize migration test setup in a shared helper and update the migration tests to use the common pre-migration initialization flow. - This removes repeated fixture boilerplate while keeping each test focused on the migration behavior it verifies.
- Replace duplicate pytest import helper fixtures with PluginMixin-based setup helpers. - Keep plugin import tests aligned with shared beets setup behavior.
- Dropped unused MusicBrainZ and Subsonic test helpers and imports. - Keeps plugin test modules focused on the behavior they still exercise.
7de9e4d to
f38bad8
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.
helperfixtures.test/library/test_migrations.pynow usesMigrationTestHelperto provide one common migration harness, with each test class defining only the legacy state and migration it needs.test/plugins/test_fuzzy.py,test/plugins/test_missing.py, andtest/plugins/utils/test_playcount.pynow rely on shared helpers likePluginTestHelperandTestHelperfor common setup.Note: I kept these fixtures in these files
test_query.pyplugins/test_random.pyplugins/test_aura.pyplugins/test_lyrics.pybecause they intentionally use a higher
scope, for example intest_query.py:Using this setup pattern in
test_query.pysignificantly improved testing durations.Architecture impact
High-level outcome