From 0ed2fbc7b006e4cb2f87287687789686dc755349 Mon Sep 17 00:00:00 2001 From: Jack Wilsdon Date: Tue, 31 Aug 2021 21:28:03 +0100 Subject: [PATCH] Tidy up plugins in ui config tests Some of these tests load plugins using beets' normal plugin loader, but didn't call unload_plugins to tidy up afterwards. This led to any future plugin loads being ignored until the next unload_plugins call. This commit changes the config tests so that we always call load_plugins on setup (to store the default beets state) and unload_plugins on teardown (to restore the previously stored state). --- test/test_ui.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/test_ui.py b/test/test_ui.py index 25dd68ed7..8bb6957a4 100644 --- a/test/test_ui.py +++ b/test/test_ui.py @@ -770,6 +770,7 @@ class ConfigTest(unittest.TestCase, TestHelper, _common.Assertions): os.makedirs(self.beetsdir) self._reset_config() + self.load_plugins() def tearDown(self): commands.default_commands.pop() @@ -780,6 +781,7 @@ class ConfigTest(unittest.TestCase, TestHelper, _common.Assertions): del os.environ['APPDATA'] else: os.environ['APPDATA'] = self._old_appdata + self.unload_plugins() self.teardown_beets() def _make_test_cmd(self):