beetbox / beets

music library manager and MusicBrainz tagger
http://beets.io/
MIT License
12.79k stars 1.82k forks source link

lyrics: config in tests not reset before each test #5133

Open edgars-supe opened 7 months ago

edgars-supe commented 7 months ago

Problem

Running unit tests for the lyrics plugin, specifically LRCLibLyricsTest, it seems that self.config is not re-initialized before each test.

When fixing an issue regarding synced lyrics (see #5089), I noticed that some LRCLib tests were failing after I changed plugin.config["synced"] to true in a test I added. To circumvent that, I explicitly set it to false for the failing tests and that fixed the issue. However, the issue remains that the config seems to persist between individual tests, which it shouldn't do.

To reproduce, checkout the code in #5089, comment out self.plugin.config["synced"] = False in test_fetch_synced_lyrics and test_fetch_plain_lyrics and run the tests in LRCLibLyricsTest.

Setup