[#289] Move temp dir fixture to testlib #289

Merged
abereziny merged 1 commit from abereziny/frostfs-testlib:feature--10554 into master 2024-09-10 13:33:03 +00:00
2 changed files with 12 additions and 2 deletions

View file

@ -1,3 +1,3 @@
__version__ = "2.0.1" __version__ = "2.0.1"
from .fixtures import configure_testlib, hosting from .fixtures import configure_testlib, hosting, temp_directory

View file

@ -7,7 +7,7 @@ import yaml
from frostfs_testlib import reporter from frostfs_testlib import reporter
from frostfs_testlib.hosting.hosting import Hosting from frostfs_testlib.hosting.hosting import Hosting
from frostfs_testlib.resources.common import HOSTING_CONFIG_FILE from frostfs_testlib.resources.common import ASSETS_DIR, HOSTING_CONFIG_FILE
from frostfs_testlib.storage import get_service_registry from frostfs_testlib.storage import get_service_registry
@ -24,6 +24,16 @@ def configure_testlib():
registry.register_service(svc.name, svc.load()) registry.register_service(svc.name, svc.load())
@pytest.fixture(scope="session")
def temp_directory(configure_testlib):
with reporter.step("Prepare tmp directory"):
full_path = ASSETS_DIR
if not os.path.exists(full_path):
os.mkdir(full_path)
return full_path
@pytest.fixture(scope="session") @pytest.fixture(scope="session")
def hosting(configure_testlib) -> Hosting: def hosting(configure_testlib) -> Hosting:
with open(HOSTING_CONFIG_FILE, "r") as file: with open(HOSTING_CONFIG_FILE, "r") as file: