diff --git a/swh/storage/tests/test_api_client.py b/swh/storage/tests/test_api_client.py --- a/swh/storage/tests/test_api_client.py +++ b/swh/storage/tests/test_api_client.py @@ -3,8 +3,9 @@ # License: GNU General Public License version 3, or any later version # See top-level LICENSE file for more information -import unittest +import shutil import tempfile +import unittest from swh.core.tests.server_testing import ServerTestFixture from swh.storage.tests.test_storage import CommonTestStorage @@ -27,7 +28,7 @@ # AbstractTestStorage's setUp() # To avoid confusion, override the self.objroot to a # one chosen in this class. - storage_base = tempfile.mkdtemp() + self.storage_base = tempfile.mkdtemp() self.config = { 'storage': { 'cls': 'local', @@ -36,8 +37,8 @@ 'objstorage': { 'cls': 'pathslicing', 'args': { - 'root': storage_base, - 'slicing': '0:2/2:4/4:6', + 'root': self.storage_base, + 'slicing': '0:2', }, }, } @@ -46,4 +47,8 @@ self.app = app super().setUp() self.storage = RemoteStorage(self.url()) - self.objroot = storage_base + self.objroot = self.storage_base + + def tearDown(self): + super().tearDown() + shutil.rmtree(self.storage_base)