diff --git a/tests/test_config.py b/tests/test_config.py index 4d6ffd7..28b9552 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -31,8 +31,7 @@ class TestMergeFiles(unittest.TestCase): self.assertIsInstance(config.merge_files([]), Path) def tearDown(self): - self.patched_path.stop() - self.patched_tempfile.stop() + patch.stopall() class TestParseConfig(unittest.TestCase): @@ -54,6 +53,4 @@ class TestParseConfig(unittest.TestCase): config.parse_configfile() def tearDown(self): - self.patched_config_file.stop() - self.patched_path.stop() - self.patched_serialize.stop() + patch.stopall() diff --git a/tests/test_hierarchy.py b/tests/test_hierarchy.py index 39179ce..a53ec55 100644 --- a/tests/test_hierarchy.py +++ b/tests/test_hierarchy.py @@ -43,7 +43,7 @@ class TestHierarchyPaths(unittest.TestCase): h._gen_metadata() def tearDown(self): - self.patched_path.stop() + patch.stopall() class TestHierarchyMetadata(unittest.TestCase): @@ -123,6 +123,4 @@ class TestHierarchyCleanup(unittest.TestCase): self.mocked_shutil.rmtree.assert_called_once() def tearDown(self): - self.patched_metadata.stop() - self.patched_path.stop() - self.patched_shutil.stop() + patch.stopall() diff --git a/tests/test_packagemanager.py b/tests/test_packagemanager.py index c5935d5..c133a97 100644 --- a/tests/test_packagemanager.py +++ b/tests/test_packagemanager.py @@ -40,10 +40,7 @@ class TestCreatePackageManager(unittest.TestCase): PackageManager("nothing", "nothing", l) def tearDown(self): - self.patched_path.stop() - self.patched_subprocess.stop() - self.patched_tarfile.stop() - self.patched_tempfile.stop() + patch.stopall() class TestPackageManagerMethods(unittest.TestCase): @@ -110,7 +107,4 @@ class TestPackageManagerMethods(unittest.TestCase): self.p.gen_db_archive(invalid_mode) def tearDown(self): - self.patched_path.stop() - self.patched_subprocess.stop() - self.patched_tarfile.stop() - self.patched_tempfile.stop() + patch.stopall() diff --git a/tests/test_repository.py b/tests/test_repository.py index 292e3da..4da38fb 100644 --- a/tests/test_repository.py +++ b/tests/test_repository.py @@ -100,9 +100,7 @@ class TestRepositoryPreCreate(unittest.TestCase): self.assertTrue(all(isinstance(p, Snapshot) for p in repo)) def tearDown(self): - self.patched_path.stop() - self.patched_metadata.stop() - self.patched_snapshot.stop() + patch.stopall() class TestRepositoryPostCreate(unittest.TestCase): @@ -181,9 +179,7 @@ class TestRepositoryPostCreate(unittest.TestCase): self.assertEqual(len(repo), 1) def tearDown(self): - self.patched_path.stop() - self.patched_metadata.stop() - self.patched_snapshot.stop() + patch.stopall() @unittest.skip("Fix call checks") @@ -253,7 +249,4 @@ class TestRepositoryCleanup(unittest.TestCase): self.mocked_shutil.rmtree.assert_called_once() def tearDown(self): - self.patched_metadata.stop() - self.patched_path.stop() - self.patched_shutil.stop() - self.patched_snapshot.stop() + patch.stopall() diff --git a/tests/test_snapshot.py b/tests/test_snapshot.py index d2c86e6..119d885 100644 --- a/tests/test_snapshot.py +++ b/tests/test_snapshot.py @@ -34,5 +34,4 @@ class TestSnapshotProperties(unittest.TestCase): self.assertIsInstance(Snapshot("/tmp/backup/snapshot").ctime, str) def tearDown(self): - self.patched_path.stop() - self.patched_metadata.stop() + patch.stopall()