From a9f7e9fb7ab3dd9fcc286846b159575ee8b43ba7 Mon Sep 17 00:00:00 2001 From: hroff-1902 Date: Mon, 9 Dec 2019 12:49:04 +0300 Subject: [PATCH] Fix NO_CONF; fix tests --- freqtrade/configuration/arguments.py | 2 +- tests/test_utils.py | 32 +++++++++++++++++++++------- 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/freqtrade/configuration/arguments.py b/freqtrade/configuration/arguments.py index 799cd7d20..41c5c3957 100644 --- a/freqtrade/configuration/arguments.py +++ b/freqtrade/configuration/arguments.py @@ -62,7 +62,7 @@ ARGS_HYPEROPT_SHOW = ["hyperopt_list_best", "hyperopt_list_profitable", "hyperop "print_json", "hyperopt_show_no_header"] NO_CONF_REQURIED = ["download-data", "list-timeframes", "list-markets", "list-pairs", - "hyperopt_list", "hyperopt_show", "plot-dataframe", "plot-profit"] + "hyperopt-list", "hyperopt-show", "plot-dataframe", "plot-profit"] NO_CONF_ALLOWED = ["create-userdir", "list-exchanges", "new-hyperopt", "new-strategy"] diff --git a/tests/test_utils.py b/tests/test_utils.py index 3fc92e14b..f7bb12799 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -670,7 +670,9 @@ def test_hyperopt_list(mocker, capsys, hyperopt_results): "hyperopt-list", "--no-details" ] - start_hyperopt_list(get_args(args)) + pargs = get_args(args) + pargs['config'] = None + start_hyperopt_list(pargs) captured = capsys.readouterr() assert all(x in captured.out for x in [" 1/12", " 2/12", " 3/12", " 4/12", " 5/12", @@ -681,7 +683,9 @@ def test_hyperopt_list(mocker, capsys, hyperopt_results): "--best", "--no-details" ] - start_hyperopt_list(get_args(args)) + pargs = get_args(args) + pargs['config'] = None + start_hyperopt_list(pargs) captured = capsys.readouterr() assert all(x in captured.out for x in [" 1/12", " 5/12", " 10/12"]) @@ -693,7 +697,9 @@ def test_hyperopt_list(mocker, capsys, hyperopt_results): "--profitable", "--no-details" ] - start_hyperopt_list(get_args(args)) + pargs = get_args(args) + pargs['config'] = None + start_hyperopt_list(pargs) captured = capsys.readouterr() assert all(x in captured.out for x in [" 2/12", " 10/12"]) @@ -711,7 +717,9 @@ def test_hyperopt_show(mocker, capsys, hyperopt_results): args = [ "hyperopt-show", ] - start_hyperopt_show(get_args(args)) + pargs = get_args(args) + pargs['config'] = None + start_hyperopt_show(pargs) captured = capsys.readouterr() assert " 12/12" in captured.out @@ -719,7 +727,9 @@ def test_hyperopt_show(mocker, capsys, hyperopt_results): "hyperopt-show", "--best" ] - start_hyperopt_show(get_args(args)) + pargs = get_args(args) + pargs['config'] = None + start_hyperopt_show(pargs) captured = capsys.readouterr() assert " 10/12" in captured.out @@ -727,7 +737,9 @@ def test_hyperopt_show(mocker, capsys, hyperopt_results): "hyperopt-show", "-n", "1" ] - start_hyperopt_show(get_args(args)) + pargs = get_args(args) + pargs['config'] = None + start_hyperopt_show(pargs) captured = capsys.readouterr() assert " 1/12" in captured.out @@ -736,7 +748,9 @@ def test_hyperopt_show(mocker, capsys, hyperopt_results): "--best", "-n", "2" ] - start_hyperopt_show(get_args(args)) + pargs = get_args(args) + pargs['config'] = None + start_hyperopt_show(pargs) captured = capsys.readouterr() assert " 5/12" in captured.out @@ -745,6 +759,8 @@ def test_hyperopt_show(mocker, capsys, hyperopt_results): "--best", "-n", "-1" ] - start_hyperopt_show(get_args(args)) + pargs = get_args(args) + pargs['config'] = None + start_hyperopt_show(pargs) captured = capsys.readouterr() assert " 10/12" in captured.out