Skip to content

fix(lastgenre): Reset plugin config in fixtured tests#6386

Open
Nukesor wants to merge 1 commit intobeetbox:masterfrom
Nukesor:lastgenre-fix-bleeding-tests
Open

fix(lastgenre): Reset plugin config in fixtured tests#6386
Nukesor wants to merge 1 commit intobeetbox:masterfrom
Nukesor:lastgenre-fix-bleeding-tests

Conversation

@Nukesor
Copy link
Contributor

@Nukesor Nukesor commented Feb 21, 2026

Description

Fixes a bug in the lastgenre plugin, where test state bled into the following fixtures.

Each plugin has a view to the global persisted beets.config field. As a result, config variables that aren't explicitly overwritten are persisted in that global config view.

This commit exposes the lastgenre default config as a static method and uses that default config to reset the state in between fixture calls.

There were 5 tests that depended on count: 10 being set on previous test fixtures, which I adjusted accordingly.

Discovered and discussed in #6317 , see #6317 (comment)

@Nukesor Nukesor requested a review from a team as a code owner February 21, 2026 14:55
@github-actions
Copy link

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

codecov bot commented Feb 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.96%. Comparing base (83f1671) to head (9a8b2ac).
⚠️ Report is 4 commits behind head on master.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #6386   +/-   ##
=======================================
  Coverage   68.96%   68.96%           
=======================================
  Files         140      140           
  Lines       18685    18688    +3     
  Branches     3056     3056           
=======================================
+ Hits        12886    12889    +3     
  Misses       5155     5155           
  Partials      644      644           
Files with missing lines Coverage Δ
beetsplug/lastgenre/__init__.py 70.43% <100.00%> (+0.32%) ⬆️
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Nukesor Nukesor force-pushed the lastgenre-fix-bleeding-tests branch 2 times, most recently from 6bc305b to 9a8b2ac Compare February 21, 2026 15:48
Fixes a bug in the lastgenre, where test state bled into the following fixtures.

Each plugin has a view to the global persisted beets.config field. As a result,
variables that aren't explicitly overwritten are persisted in that global config view.

This commit exposes the default config as a static method and uses that default
config to reset the state in between fixture calls.

There were 5 tests that depended on count: 10 being set on previous test fixtures,
which I adjusted accordingly.
@Nukesor Nukesor force-pushed the lastgenre-fix-bleeding-tests branch from 9a8b2ac to 67544a4 Compare February 23, 2026 16:48
@Nukesor
Copy link
Contributor Author

Nukesor commented Feb 23, 2026

The test failure seems to be a flaky one?

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.

1 participant