Make use of patch.stopall()
This commit is contained in:
parent
3bbd2b2793
commit
dbb5c0fa8b
@ -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()
|
||||
|
@ -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()
|
||||
|
@ -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()
|
||||
|
@ -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()
|
||||
|
@ -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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user