Avoid having test-result influence from user_data/

this avoids potential deprecation warnings (or even errors)
 caused by strategies in user_data/strategies
This commit is contained in:
Matthias
2024-04-25 10:42:55 +02:00
parent 96bb4db68e
commit ad12c98d10
3 changed files with 7 additions and 4 deletions

View File

@@ -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"

View File

@@ -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(

View File

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