From 56c9bcd6a0614e233e288485b93d6b547fd9e45a Mon Sep 17 00:00:00 2001 From: Laurent Monin Date: Wed, 6 Nov 2024 10:15:40 +0100 Subject: [PATCH 1/2] tests: add missing parent setUp() calls --- test/picardtestcase.py | 2 ++ test/test_debug_opt.py | 1 + test/test_mbjson.py | 1 + 3 files changed, 4 insertions(+) diff --git a/test/picardtestcase.py b/test/picardtestcase.py index 580ddaa491..9dee0ecc06 100644 --- a/test/picardtestcase.py +++ b/test/picardtestcase.py @@ -83,7 +83,9 @@ def get_release_group_by_id(self, rg_id): # pylint: disable=no-self-use class PicardTestCase(unittest.TestCase): + def setUp(self): + super().setUp() log.set_level(logging.DEBUG) setup_gettext(None, 'C') self.tagger = FakeTagger() diff --git a/test/test_debug_opt.py b/test/test_debug_opt.py index 0f697323ee..a534d3044a 100644 --- a/test/test_debug_opt.py +++ b/test/test_debug_opt.py @@ -30,6 +30,7 @@ class DebugOptTestCase(DebugOptEnum): class TestDebugOpt(PicardTestCase): def setUp(self): + super().setUp() DebugOptTestCase.set_registry(set()) def test_enabled(self): diff --git a/test/test_mbjson.py b/test/test_mbjson.py index f466fc5450..73b2e8dd7d 100644 --- a/test/test_mbjson.py +++ b/test/test_mbjson.py @@ -664,6 +664,7 @@ def test_locale_specific_match_first_exc2(self): class TestAliasesLocales(PicardTestCase): def setUp(self): + super().setUp() self.maxDiff = None self.aliases = [ From 5f5411530f5000f5025f91315b5bb6ed5f133eb6 Mon Sep 17 00:00:00 2001 From: Laurent Monin Date: Wed, 6 Nov 2024 10:16:08 +0100 Subject: [PATCH 2/2] tests: remove useless tearDown() definitions --- test/test_metadata.py | 3 --- test/test_plugins.py | 3 --- 2 files changed, 6 deletions(-) diff --git a/test/test_metadata.py b/test/test_metadata.py index 1d2c6e7106..55a9490926 100644 --- a/test/test_metadata.py +++ b/test/test_metadata.py @@ -102,9 +102,6 @@ def setUp(self): def get_metadata_object(): pass - def tearDown(self): - pass - def test_metadata_setitem(self): self.assertEqual(["single1-value"], self.metadata.getraw("single1")) self.assertEqual(["single2-value"], self.metadata.getraw("single2")) diff --git a/test/test_plugins.py b/test/test_plugins.py index 57f09a0cc4..dfdaac3e9a 100644 --- a/test/test_plugins.py +++ b/test/test_plugins.py @@ -105,9 +105,6 @@ def setUp(self): super().setUp() logging.disable(logging.ERROR) - def tearDown(self): - pass - class TestPicardPluginsCommonTmpDir(TestPicardPluginsCommon):