[#289] Move temp dir fixture to testlib
Some checks failed
DCO action / DCO (pull_request) Has been cancelled

Signed-off-by: a.berezin <a.berezin@yadro.com>
This commit is contained in:
Andrey Berezin 2024-09-10 15:14:32 +03:00 committed by Andrey Berezin
parent 84e83487f9
commit 565fd4c72b
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: