mirror of
https://github.com/freqtrade/freqtrade.git
synced 2026-02-26 06:11:45 +00:00
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:
@@ -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"
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user