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"