diff --git a/beets/ui/__init__.py b/beets/ui/__init__.py index e09043cbb..02a7a9478 100644 --- a/beets/ui/__init__.py +++ b/beets/ui/__init__.py @@ -839,8 +839,8 @@ def _setup(options, lib=None): if lib is None: lib = _open_library(config) plugins.send("library_opened", lib=lib) - library.Item._types = plugins.types(library.Item) - library.Album._types = plugins.types(library.Album) + library.Item._types.update(plugins.types(library.Item)) + library.Album._types.update(plugins.types(library.Album)) return subcommands, plugins, lib diff --git a/test/helper.py b/test/helper.py index 64db9e8b1..e929eecff 100644 --- a/test/helper.py +++ b/test/helper.py @@ -199,8 +199,11 @@ class TestHelper(object): beets.config['plugins'] = plugins beets.plugins.load_plugins(plugins) beets.plugins.find_plugins() - Item._types = beets.plugins.types(Item) - Album._types = beets.plugins.types(Album) + # Take a backup of the original _types to restore when unloading + Item._original_types = dict(Item._types) + Album._original_types = dict(Album._types) + Item._types.update(beets.plugins.types(Item)) + Album._types.update(beets.plugins.types(Album)) def unload_plugins(self): """Unload all plugins and remove the from the configuration. @@ -209,8 +212,8 @@ class TestHelper(object): beets.config['plugins'] = [] beets.plugins._classes = set() beets.plugins._instances = {} - Item._types = {} - Album._types = {} + Item._types = Item._original_types + Album._types = Album._original_types def create_importer(self, item_count=1, album_count=1): """Create files to import and return corresponding session.