diff --git a/tests/commands/test_commands.py b/tests/commands/test_commands.py index a1d73f7ef..d568f48f6 100644 --- a/tests/commands/test_commands.py +++ b/tests/commands/test_commands.py @@ -1529,7 +1529,7 @@ def test_backtesting_show(mocker, testdatadir, capsys): args = [ "backtesting-show", "--export-filename", - f"{testdatadir / 'backtest_results/backtest-result_new.json'}", + f"{testdatadir / 'backtest_results/backtest-result.json'}", "--show-pair-list" ] pargs = get_args(args) diff --git a/tests/data/test_btanalysis.py b/tests/data/test_btanalysis.py index 95de6b53e..1cc1aa0c9 100644 --- a/tests/data/test_btanalysis.py +++ b/tests/data/test_btanalysis.py @@ -30,10 +30,10 @@ def test_get_latest_backtest_filename(testdatadir, mocker): testdir_bt = testdatadir / "backtest_results" res = get_latest_backtest_filename(testdir_bt) - assert res == 'backtest-result_new.json' + assert res == 'backtest-result.json' res = get_latest_backtest_filename(str(testdir_bt)) - assert res == 'backtest-result_new.json' + assert res == 'backtest-result.json' mocker.patch("freqtrade.data.btanalysis.json_load", return_value={}) @@ -81,7 +81,7 @@ def test_load_backtest_data_old_format(testdatadir, mocker): def test_load_backtest_data_new_format(testdatadir): - filename = testdatadir / "backtest_results/backtest-result_new.json" + filename = testdatadir / "backtest_results/backtest-result.json" bt_data = load_backtest_data(filename) assert isinstance(bt_data, DataFrame) assert set(bt_data.columns) == set(BT_DATA_COLUMNS) @@ -182,7 +182,7 @@ def test_extract_trades_of_period(testdatadir): def test_analyze_trade_parallelism(testdatadir): - filename = testdatadir / "backtest_results/backtest-result_new.json" + filename = testdatadir / "backtest_results/backtest-result.json" bt_data = load_backtest_data(filename) res = analyze_trade_parallelism(bt_data, "5m") @@ -256,7 +256,7 @@ def test_combine_dataframes_with_mean_no_data(testdatadir): def test_create_cum_profit(testdatadir): - filename = testdatadir / "backtest_results/backtest-result_new.json" + filename = testdatadir / "backtest_results/backtest-result.json" bt_data = load_backtest_data(filename) timerange = TimeRange.parse_timerange("20180110-20180112") @@ -272,7 +272,7 @@ def test_create_cum_profit(testdatadir): def test_create_cum_profit1(testdatadir): - filename = testdatadir / "backtest_results/backtest-result_new.json" + filename = testdatadir / "backtest_results/backtest-result.json" bt_data = load_backtest_data(filename) # Move close-time to "off" the candle, to make sure the logic still works bt_data['close_date'] = bt_data.loc[:, 'close_date'] + DateOffset(seconds=20) @@ -294,7 +294,7 @@ def test_create_cum_profit1(testdatadir): def test_calculate_max_drawdown(testdatadir): - filename = testdatadir / "backtest_results/backtest-result_new.json" + filename = testdatadir / "backtest_results/backtest-result.json" bt_data = load_backtest_data(filename) _, hdate, lowdate, hval, lval, drawdown = calculate_max_drawdown( bt_data, value_col="profit_abs") @@ -318,7 +318,7 @@ def test_calculate_max_drawdown(testdatadir): def test_calculate_csum(testdatadir): - filename = testdatadir / "backtest_results/backtest-result_new.json" + filename = testdatadir / "backtest_results/backtest-result.json" bt_data = load_backtest_data(filename) csum_min, csum_max = calculate_csum(bt_data) diff --git a/tests/optimize/test_optimize_reports.py b/tests/optimize/test_optimize_reports.py index 403075795..549202284 100644 --- a/tests/optimize/test_optimize_reports.py +++ b/tests/optimize/test_optimize_reports.py @@ -308,7 +308,7 @@ def test_generate_pair_metrics(): def test_generate_daily_stats(testdatadir): - filename = testdatadir / "backtest_results/backtest-result_new.json" + filename = testdatadir / "backtest_results/backtest-result.json" bt_data = load_backtest_data(filename) res = generate_daily_stats(bt_data) assert isinstance(res, dict) @@ -328,7 +328,7 @@ def test_generate_daily_stats(testdatadir): def test_generate_trading_stats(testdatadir): - filename = testdatadir / "backtest_results/backtest-result_new.json" + filename = testdatadir / "backtest_results/backtest-result.json" bt_data = load_backtest_data(filename) res = generate_trading_stats(bt_data) assert isinstance(res, dict) @@ -444,7 +444,7 @@ def test_generate_edge_table(): def test_generate_periodic_breakdown_stats(testdatadir): - filename = testdatadir / "backtest_results/backtest-result_new.json" + filename = testdatadir / "backtest_results/backtest-result.json" bt_data = load_backtest_data(filename).to_dict(orient='records') res = generate_periodic_breakdown_stats(bt_data, 'day') @@ -472,7 +472,7 @@ def test__get_resample_from_period(): def test_show_sorted_pairlist(testdatadir, default_conf, capsys): - filename = testdatadir / "backtest_results/backtest-result_new.json" + filename = testdatadir / "backtest_results/backtest-result.json" bt_data = load_backtest_stats(filename) default_conf['backtest_show_pair_list'] = True diff --git a/tests/rpc/test_rpc_apiserver.py b/tests/rpc/test_rpc_apiserver.py index aea8ea059..2a2a38196 100644 --- a/tests/rpc/test_rpc_apiserver.py +++ b/tests/rpc/test_rpc_apiserver.py @@ -1709,7 +1709,7 @@ def test_api_backtest_history(botclient, mocker, testdatadir): mocker.patch('freqtrade.data.btanalysis._get_backtest_files', return_value=[ testdatadir / 'backtest_results/backtest-result_multistrat.json', - testdatadir / 'backtest_results/backtest-result_new.json' + testdatadir / 'backtest_results/backtest-result.json' ]) rc = client_get(client, f"{BASE_URI}/backtest/history") diff --git a/tests/test_plotting.py b/tests/test_plotting.py index 64089c4c6..7662ea7f1 100644 --- a/tests/test_plotting.py +++ b/tests/test_plotting.py @@ -46,7 +46,7 @@ def test_init_plotscript(default_conf, mocker, testdatadir): default_conf['trade_source'] = "file" default_conf['timeframe'] = "5m" default_conf["datadir"] = testdatadir - default_conf['exportfilename'] = testdatadir / "backtest-result_new.json" + default_conf['exportfilename'] = testdatadir / "backtest-result.json" supported_markets = ["TRX/BTC", "ADA/BTC"] ret = init_plotscript(default_conf, supported_markets) assert "ohlcv" in ret @@ -158,7 +158,7 @@ def test_plot_trades(testdatadir, caplog): assert fig == fig1 assert log_has("No trades found.", caplog) pair = "ADA/BTC" - filename = testdatadir / "backtest_results/backtest-result_new.json" + filename = testdatadir / "backtest_results/backtest-result.json" trades = load_backtest_data(filename) trades = trades.loc[trades['pair'] == pair] @@ -299,7 +299,7 @@ def test_generate_plot_file(mocker, caplog): def test_add_profit(testdatadir): - filename = testdatadir / "backtest_results/backtest-result_new.json" + filename = testdatadir / "backtest_results/backtest-result.json" bt_data = load_backtest_data(filename) timerange = TimeRange.parse_timerange("20180110-20180112") @@ -319,7 +319,7 @@ def test_add_profit(testdatadir): def test_generate_profit_graph(testdatadir): - filename = testdatadir / "backtest_results/backtest-result_new.json" + filename = testdatadir / "backtest_results/backtest-result.json" trades = load_backtest_data(filename) timerange = TimeRange.parse_timerange("20180110-20180112") pairs = ["TRX/BTC", "XLM/BTC"] @@ -395,7 +395,7 @@ def test_load_and_plot_trades(default_conf, mocker, caplog, testdatadir): default_conf['trade_source'] = 'file' default_conf["datadir"] = testdatadir - default_conf['exportfilename'] = testdatadir / "backtest-result_new.json" + default_conf['exportfilename'] = testdatadir / "backtest-result.json" default_conf['indicators1'] = ["sma5", "ema10"] default_conf['indicators2'] = ["macd"] default_conf['pairs'] = ["ETH/BTC", "LTC/BTC"] @@ -466,7 +466,7 @@ def test_plot_profit(default_conf, mocker, testdatadir): match=r"No trades found, cannot generate Profit-plot.*"): plot_profit(default_conf) - default_conf['exportfilename'] = testdatadir / "backtest_results/backtest-result_new.json" + default_conf['exportfilename'] = testdatadir / "backtest_results/backtest-result.json" plot_profit(default_conf) diff --git a/tests/testdata/backtest_results/.last_result.json b/tests/testdata/backtest_results/.last_result.json index 98448e10f..7ebab4613 100644 --- a/tests/testdata/backtest_results/.last_result.json +++ b/tests/testdata/backtest_results/.last_result.json @@ -1 +1 @@ -{"latest_backtest":"backtest-result_new.json"} +{"latest_backtest":"backtest-result.json"} diff --git a/tests/testdata/backtest_results/backtest-result_new.json b/tests/testdata/backtest_results/backtest-result.json similarity index 100% rename from tests/testdata/backtest_results/backtest-result_new.json rename to tests/testdata/backtest_results/backtest-result.json diff --git a/tests/testdata/backtest_results/backtest-result_new.meta.json b/tests/testdata/backtest_results/backtest-result.meta.json similarity index 100% rename from tests/testdata/backtest_results/backtest-result_new.meta.json rename to tests/testdata/backtest_results/backtest-result.meta.json