From c8abcab2a8d846b33e0890c4aa9d72254f3bd4c5 Mon Sep 17 00:00:00 2001 From: Vladimir Domnich Date: Wed, 13 Jul 2022 10:12:26 +0400 Subject: [PATCH] Fix moment when temp_dir fixture is invoked. --- .gitignore | 3 +++ pytest_tests/testsuites/conftest.py | 17 +++++++---------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index 9f1eafe7..0e454b86 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ +# ignore IDE files +.vscode + # ignore test results **/log.html **/output.xml diff --git a/pytest_tests/testsuites/conftest.py b/pytest_tests/testsuites/conftest.py index 4b7ad46a..e0d0b989 100644 --- a/pytest_tests/testsuites/conftest.py +++ b/pytest_tests/testsuites/conftest.py @@ -37,25 +37,22 @@ def check_binary_versions(request): out_file.write(f'{env}={env_value}\n') -@pytest.fixture(scope='session') -@allure.title('Init wallet with address') -def init_wallet_with_address(): - full_path = f'{os.getcwd()}/{ASSETS_DIR}' - os.mkdir(full_path) - - yield wallet.init_wallet(ASSETS_DIR) - - @pytest.fixture(scope='session') @allure.title('Prepare tmp directory') def prepare_tmp_dir(): full_path = f'{os.getcwd()}/{ASSETS_DIR}' shutil.rmtree(full_path, ignore_errors=True) os.mkdir(full_path) - yield + yield full_path shutil.rmtree(full_path) +@pytest.fixture(scope='session') +@allure.title('Init wallet with address') +def init_wallet_with_address(prepare_tmp_dir): + yield wallet.init_wallet(ASSETS_DIR) + + @pytest.fixture(scope='session') @allure.title('Prepare wallet and deposit') def prepare_wallet_and_deposit(init_wallet_with_address):