diff --git a/tests/optimize/test_hyperopt_tools.py b/tests/optimize/test_hyperopt_tools.py index c46897374..47aba6b76 100644 --- a/tests/optimize/test_hyperopt_tools.py +++ b/tests/optimize/test_hyperopt_tools.py @@ -172,8 +172,8 @@ def test__pprint_dict(): }""" -def test_get_strategy_filename(default_conf): - +def test_get_strategy_filename(default_conf, tmp_path): + default_conf['user_data_dir'] = tmp_path x = HyperoptTools.get_strategy_filename(default_conf, 'StrategyTestV3') assert isinstance(x, Path) assert x == Path(__file__).parents[1] / 'strategy/strats/strategy_test_v3.py' @@ -233,6 +233,7 @@ def test_export_params(tmp_path): def test_try_export_params(default_conf, tmp_path, caplog, mocker): default_conf['disableparamexport'] = False + default_conf['user_data_dir'] = tmp_path export_mock = mocker.patch("freqtrade.optimize.hyperopt_tools.HyperoptTools.export_params") filename = tmp_path / f"{CURRENT_TEST_STRATEGY}.json" diff --git a/tests/optimize/test_recursive_analysis.py b/tests/optimize/test_recursive_analysis.py index 33fae0d08..95a96c9f5 100644 --- a/tests/optimize/test_recursive_analysis.py +++ b/tests/optimize/test_recursive_analysis.py @@ -14,7 +14,8 @@ from tests.conftest import get_args, log_has_re, patch_exchange @pytest.fixture -def recursive_conf(default_conf_usdt): +def recursive_conf(default_conf_usdt, tmp_path): + default_conf_usdt['user_data_dir'] = tmp_path default_conf_usdt['timerange'] = '20220101-20220501' default_conf_usdt['strategy_path'] = str( diff --git a/tests/rpc/test_rpc_apiserver.py b/tests/rpc/test_rpc_apiserver.py index 7259dfb9a..7281686ea 100644 --- a/tests/rpc/test_rpc_apiserver.py +++ b/tests/rpc/test_rpc_apiserver.py @@ -1648,8 +1648,9 @@ def test_api_pair_history(botclient, mocker): assert rc.json()['detail'] == ("No data for UNITTEST/BTC, 5m in 20200111-20200112 found.") -def test_api_plot_config(botclient, mocker): +def test_api_plot_config(botclient, mocker, tmp_path): ftbot, client = botclient + ftbot.config['user_data_dir'] = tmp_path rc = client_get(client, f"{BASE_URI}/plot_config") assert_response(rc)