diff --git a/tests/optimize/test_lookahead_analysis.py b/tests/optimize/test_lookahead_analysis.py index 14840428d..6c84663b6 100644 --- a/tests/optimize/test_lookahead_analysis.py +++ b/tests/optimize/test_lookahead_analysis.py @@ -14,7 +14,8 @@ from tests.conftest import EXMS, get_args, log_has_re, patch_exchange @pytest.fixture -def lookahead_conf(default_conf_usdt): +def lookahead_conf(default_conf_usdt, tmp_path): + default_conf_usdt['user_data_dir'] = tmp_path default_conf_usdt['minimum_trade_amount'] = 10 default_conf_usdt['targeted_trade_amount'] = 20 default_conf_usdt['timerange'] = '20220101-20220501' diff --git a/tests/rpc/test_rpc_apiserver.py b/tests/rpc/test_rpc_apiserver.py index 7281686ea..5b189371a 100644 --- a/tests/rpc/test_rpc_apiserver.py +++ b/tests/rpc/test_rpc_apiserver.py @@ -1577,8 +1577,10 @@ def test_api_pair_candles(botclient, ohlcv_history): ]) -def test_api_pair_history(botclient, mocker): +def test_api_pair_history(botclient, tmp_path, mocker): _ftbot, client = botclient + _ftbot.config['user_data_dir'] = tmp_path + timeframe = '5m' lfm = mocker.patch('freqtrade.strategy.interface.IStrategy.load_freqAI_model') # No pair @@ -1718,8 +1720,9 @@ def test_api_strategies(botclient, tmp_path): ]} -def test_api_strategy(botclient): +def test_api_strategy(botclient, tmp_path): _ftbot, client = botclient + _ftbot.config['user_data_dir'] = tmp_path rc = client_get(client, f"{BASE_URI}/strategy/{CURRENT_TEST_STRATEGY}") diff --git a/tests/strategy/test_strategy_loading.py b/tests/strategy/test_strategy_loading.py index a31408b5c..33245cc5f 100644 --- a/tests/strategy/test_strategy_loading.py +++ b/tests/strategy/test_strategy_loading.py @@ -78,7 +78,9 @@ def test_load_strategy_base64(dataframe_1m, caplog, default_conf): r".*(/|\\).*(/|\\)SampleStrategy\.py'\.\.\.", caplog) -def test_load_strategy_invalid_directory(caplog, default_conf): +def test_load_strategy_invalid_directory(caplog, default_conf, tmp_path): + default_conf['user_data_dir'] = tmp_path + extra_dir = Path.cwd() / 'some/path' with pytest.raises(OperationalException, match=r"Impossible to load Strategy.*"): StrategyResolver._load_strategy('StrategyTestV333', config=default_conf, @@ -87,7 +89,8 @@ def test_load_strategy_invalid_directory(caplog, default_conf): assert log_has_re(r'Path .*' + r'some.*path.*' + r'.* does not exist', caplog) -def test_load_not_found_strategy(default_conf): +def test_load_not_found_strategy(default_conf, tmp_path): + default_conf['user_data_dir'] = tmp_path default_conf['strategy'] = 'NotFoundStrategy' with pytest.raises(OperationalException, match=r"Impossible to load Strategy 'NotFoundStrategy'. "