From 30baf22e77d8a9ba2cc7de408af593fa393a5e02 Mon Sep 17 00:00:00 2001 From: wisp3rwind <17089248+wisp3rwind@users.noreply.github.com> Date: Mon, 21 Dec 2020 11:04:29 +0100 Subject: [PATCH] replaygain: Use on-disk database there can only be a single connection to an in-memory database, but the parallel replaygain code accesses the db from different threads --- test/test_replaygain.py | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/test/test_replaygain.py b/test/test_replaygain.py index 21a5fa5a7..0100b520e 100644 --- a/test/test_replaygain.py +++ b/test/test_replaygain.py @@ -22,14 +22,11 @@ import six from mock import patch from test.helper import TestHelper, capture_log, has_program -from sqlite3 import OperationalError - from beets import config from beets.util import CommandOutput from mediafile import MediaFile from beetsplug.replaygain import (FatalGstreamerPluginReplayGainError, - GStreamerBackend, - ReplayGainPlugin) + GStreamerBackend) try: @@ -63,26 +60,9 @@ def reset_replaygain(item): item.store() -def _store_retry_once(self, item): - """Helper method to retry item.store() once in case - of a sqlite3.OperationalError exception. - - :param self: `ReplayGainPlugin` instance - :param item: a library item to store - """ - try: - item.store() - except OperationalError: - # test_replaygain.py :memory: library can fail with - # `sqlite3.OperationalError: no such table: items` - # but the second attempt succeeds - item.store() - - -@patch.object(ReplayGainPlugin, '_store', _store_retry_once) class ReplayGainCliTestBase(TestHelper): def setUp(self): - self.setup_beets() + self.setup_beets(disk=True) self.config['replaygain']['backend'] = self.backend try: