mirror of
https://github.com/beetbox/beets.git
synced 2025-12-15 13:07:09 +01:00
Tests: fix unload_plugins
Don't mutate the base classes. This was causing plugins to break on the second test that uses them, since after they were unloaded their class-level fields were broken (since the modules are not re-loaded). This makes it more clear than ever that we need to encapsulate plugin loading state using some manner of PluginManager.
This commit is contained in:
parent
d3b76d83d2
commit
42228e6d82
2 changed files with 1 additions and 2 deletions
|
|
@ -202,8 +202,6 @@ class TestHelper(object):
|
|||
"""
|
||||
# FIXME this should eventually be handled by a plugin manager
|
||||
beets.config['plugins'] = []
|
||||
for plugin in beets.plugins._classes:
|
||||
plugin.listeners = None
|
||||
beets.plugins._classes = set()
|
||||
beets.plugins._instances = {}
|
||||
Item._types = {}
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ class PermissionsPluginTest(unittest.TestCase, TestHelper):
|
|||
|
||||
def tearDown(self):
|
||||
self.teardown_beets()
|
||||
self.unload_plugins()
|
||||
|
||||
def test_permissions_on_album_imported(self):
|
||||
self.importer = self.create_importer()
|
||||
|
|
|
|||
Loading…
Reference in a new issue