From b49426046a9a02e02a29ff26b8bdb5ad0f5cf896 Mon Sep 17 00:00:00 2001 From: Diego Moreda Date: Fri, 22 Jan 2016 21:33:33 +0100 Subject: [PATCH] Fix unrestored AutotagStub on two TestCases * Call AutotagStub.restore() during the tearDown of test_mbsubmit.MBSubmitPluginTest and test_plugins.PromptChoicesTest, which could potentially lead to other tests calling mocked versions of autotag.mb.match_album, .match_track, .album_for_id and .track_for_id instead of the real functions. --- test/test_mbsubmit.py | 1 + test/test_plugins.py | 1 + 2 files changed, 2 insertions(+) diff --git a/test/test_mbsubmit.py b/test/test_mbsubmit.py index 5047fd3d0..808af9d8c 100644 --- a/test/test_mbsubmit.py +++ b/test/test_mbsubmit.py @@ -34,6 +34,7 @@ class MBSubmitPluginTest(TerminalImportSessionSetup, unittest.TestCase, def tearDown(self): self.unload_plugins() self.teardown_beets() + self.matcher.restore() def test_print_tracks_output(self): """Test the output of the "print tracks" choice.""" diff --git a/test/test_plugins.py b/test/test_plugins.py index 6f8035511..eaf2e83ed 100644 --- a/test/test_plugins.py +++ b/test/test_plugins.py @@ -419,6 +419,7 @@ class PromptChoicesTest(TerminalImportSessionSetup, unittest.TestCase, self.input_options_patcher.stop() self.teardown_plugin_loader() self.teardown_beets() + self.matcher.restore() def test_plugin_choices_in_ui_input_options_album(self): """Test the presence of plugin choices on the prompt (album)."""