From b42880907eeff4ca1303a56ef06938f73d6bd9c1 Mon Sep 17 00:00:00 2001 From: Johnny Robeson Date: Sun, 11 Sep 2016 03:51:05 -0400 Subject: [PATCH] Don't open library if we got it from the test suite --- beets/ui/__init__.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/beets/ui/__init__.py b/beets/ui/__init__.py index 2f3a75a97..4e285445f 100644 --- a/beets/ui/__init__.py +++ b/beets/ui/__init__.py @@ -939,10 +939,12 @@ def beet(ctx, **options): # Configure the MusicBrainz API. mb.configure() - # Open the library database and set it on the context. - lib = _open_library(config) - plugins.send('library_opened', lib=lib) - beets_ctx.lib = lib + # Open the library database and set it on the context + # if we didn't already get it from the test suite. + if not beets_ctx.lib: + beets_ctx.lib = _open_library(config) + + plugins.send('library_opened', lib=beets_ctx.lib) # Load field types from the plugins. library.Item._types.update(plugins.types(library.Item))