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).
This commit is contained in:
Jack Wilsdon 2021-08-31 21:28:03 +01:00
parent 75223eedb7
commit 0ed2fbc7b0

View file

@ -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):