From 31be3a916e1bd4f8d77a137eba3589d80b611f48 Mon Sep 17 00:00:00 2001 From: Serene-Arc Date: Thu, 24 Jun 2021 16:14:05 +1000 Subject: [PATCH] Enable integration tests to be run concurrently --- tests/test_integration.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/test_integration.py b/tests/test_integration.py index 3ecfcd6..0b4d36b 100644 --- a/tests/test_integration.py +++ b/tests/test_integration.py @@ -2,6 +2,7 @@ # coding=utf-8 import re +import shutil from pathlib import Path import pytest @@ -12,22 +13,28 @@ from bdfr.__main__ import cli does_test_config_exist = Path('test_config.cfg').exists() +def copy_test_config(tmp_path: Path): + shutil.copy(Path('test_config.cfg'), Path(tmp_path, 'test_config.cfg')) + + def create_basic_args_for_download_runner(test_args: list[str], tmp_path: Path): + copy_test_config(tmp_path) out = [ 'download', str(tmp_path), '-v', - '--config', 'test_config.cfg', + '--config', str(Path(tmp_path, 'test_config.cfg')), '--log', str(Path(tmp_path, 'test_log.txt')), ] + test_args return out def create_basic_args_for_archive_runner(test_args: list[str], tmp_path: Path): + copy_test_config(tmp_path) out = [ 'archive', str(tmp_path), '-v', - '--config', 'test_config.cfg', + '--config', str(Path(tmp_path, 'test_config.cfg')), '--log', str(Path(tmp_path, 'test_log.txt')), ] + test_args return out