Fix moment when temp_dir fixture is invoked.

This commit is contained in:
Vladimir Domnich 2022-07-13 10:12:26 +04:00
parent 5a7f85ca76
commit c8abcab2a8
2 changed files with 10 additions and 10 deletions

3
.gitignore vendored
View file

@ -1,3 +1,6 @@
# ignore IDE files
.vscode
# ignore test results
**/log.html
**/output.xml

View file

@ -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):