diff --git a/tests/backends/base/stored_playlists.py b/tests/backends/base/stored_playlists.py index 630898de..ef5806ef 100644 --- a/tests/backends/base/stored_playlists.py +++ b/tests/backends/base/stored_playlists.py @@ -10,10 +10,6 @@ from tests import SkipTest, data_folder class BaseStoredPlaylistsControllerTest(object): def setUp(self): - self.original_playlist_folder = settings.LOCAL_PLAYLIST_FOLDER - self.original_tag_cache = settings.LOCAL_TAG_CACHE - self.original_music_folder = settings.LOCAL_MUSIC_FOLDER - settings.LOCAL_PLAYLIST_FOLDER = tempfile.mkdtemp() settings.LOCAL_TAG_CACHE = data_folder('library_tag_cache') settings.LOCAL_MUSIC_FOLDER = data_folder('') @@ -27,9 +23,7 @@ class BaseStoredPlaylistsControllerTest(object): if os.path.exists(settings.LOCAL_PLAYLIST_FOLDER): shutil.rmtree(settings.LOCAL_PLAYLIST_FOLDER) - settings.LOCAL_PLAYLIST_FOLDER = self.original_playlist_folder - settings.LOCAL_TAG_CACHE = self.original_tag_cache - settings.LOCAL_MUSIC_FOLDER = self.original_music_folder + settings.runtime.clear() def test_create(self): playlist = self.stored.create('test') diff --git a/tests/backends/local/current_playlist_test.py b/tests/backends/local/current_playlist_test.py index 01354a06..3895497a 100644 --- a/tests/backends/local/current_playlist_test.py +++ b/tests/backends/local/current_playlist_test.py @@ -22,10 +22,9 @@ class LocalCurrentPlaylistControllerTest(BaseCurrentPlaylistControllerTest, for i in range(1, 4)] def setUp(self): - self.original_backends = settings.BACKENDS settings.BACKENDS = ('mopidy.backends.local.LocalBackend',) super(LocalCurrentPlaylistControllerTest, self).setUp() def tearDown(self): super(LocalCurrentPlaylistControllerTest, self).tearDown() - settings.BACKENDS = settings.original_backends + settings.runtime.clear() diff --git a/tests/backends/local/library_test.py b/tests/backends/local/library_test.py index 75751e3d..c0605ef2 100644 --- a/tests/backends/local/library_test.py +++ b/tests/backends/local/library_test.py @@ -17,16 +17,12 @@ class LocalLibraryControllerTest(BaseLibraryControllerTest, unittest.TestCase): backend_class = LocalBackend def setUp(self): - self.original_tag_cache = settings.LOCAL_TAG_CACHE - self.original_music_folder = settings.LOCAL_MUSIC_FOLDER - settings.LOCAL_TAG_CACHE = data_folder('library_tag_cache') settings.LOCAL_MUSIC_FOLDER = data_folder('') super(LocalLibraryControllerTest, self).setUp() def tearDown(self): - settings.LOCAL_TAG_CACHE = self.original_tag_cache - settings.LOCAL_MUSIC_FOLDER = self.original_music_folder + settings.runtime.clear() super(LocalLibraryControllerTest, self).tearDown() diff --git a/tests/backends/local/playback_test.py b/tests/backends/local/playback_test.py index 4a385a9d..a84dfcde 100644 --- a/tests/backends/local/playback_test.py +++ b/tests/backends/local/playback_test.py @@ -23,7 +23,6 @@ class LocalPlaybackControllerTest(BasePlaybackControllerTest, for i in range(1, 4)] def setUp(self): - self.original_backends = settings.BACKENDS settings.BACKENDS = ('mopidy.backends.local.LocalBackend',) super(LocalPlaybackControllerTest, self).setUp() @@ -32,7 +31,7 @@ class LocalPlaybackControllerTest(BasePlaybackControllerTest, def tearDown(self): super(LocalPlaybackControllerTest, self).tearDown() - settings.BACKENDS = settings.original_backends + settings.runtime.clear() def add_track(self, path): uri = path_to_uri(data_folder(path)) diff --git a/tests/outputs/gstreamer_test.py b/tests/outputs/gstreamer_test.py index b380197d..31d90b2a 100644 --- a/tests/outputs/gstreamer_test.py +++ b/tests/outputs/gstreamer_test.py @@ -17,7 +17,6 @@ from tests import data_folder class GStreamerOutputTest(unittest.TestCase): def setUp(self): - self.original_backends = settings.BACKENDS settings.BACKENDS = ('mopidy.backends.local.LocalBackend',) self.song_uri = path_to_uri(data_folder('song1.wav')) self.output_queue = multiprocessing.Queue() @@ -26,7 +25,7 @@ class GStreamerOutputTest(unittest.TestCase): def tearDown(self): self.output.destroy() - settings.BACKENDS = settings.original_backends + settings.runtime.clear() def send_recv(self, message): (my_end, other_end) = multiprocessing.Pipe() @@ -35,7 +34,6 @@ class GStreamerOutputTest(unittest.TestCase): my_end.poll(None) return my_end.recv() - def send(self, message): self.output_queue.put(message)