diff --git a/test/unit/container/test_sync_store.py b/test/unit/container/test_sync_store.py index 20f0268b5d..0082d7a83c 100644 --- a/test/unit/container/test_sync_store.py +++ b/test/unit/container/test_sync_store.py @@ -69,7 +69,7 @@ class TestContainerSyncStore(unittest.TestCase): with open(db_file, 'w') as outfile: outfile.write('%s' % db_file) - def teardown(self): + def tearDown(self): rmtree(self.test_dir_prefix) def pick_dbfile(self): diff --git a/test/unit/proxy/test_server.py b/test/unit/proxy/test_server.py index 7f3e9c5be7..2766ebea22 100644 --- a/test/unit/proxy/test_server.py +++ b/test/unit/proxy/test_server.py @@ -6603,10 +6603,16 @@ class TestECMismatchedFA(unittest.TestCase): class TestECGets(unittest.TestCase): + def setUp(self): + super(TestECGets, self).setUp() + self.tempdir = mkdtemp() + def tearDown(self): + rmtree(self.tempdir, ignore_errors=True) prosrv = _test_servers[0] # don't leak error limits and poison other tests prosrv._error_limiting = {} + super(TestECGets, self).tearDown() def _setup_nodes_and_do_GET(self, objs, node_state): """ @@ -6666,7 +6672,7 @@ class TestECGets(unittest.TestCase): # move all hash dir files to per-node, per-obj tempdir for node_index, hash_dir in node_hash_dirs.items(): - node_tmp_dirs[node_index][ref] = mkdtemp() + node_tmp_dirs[node_index][ref] = mkdtemp(dir=self.tempdir) for f in os.listdir(hash_dir): move(os.path.join(hash_dir, f), os.path.join(node_tmp_dirs[node_index][ref], f))