From 59370672b811aba5bcee1f3597f59375c5df2994 Mon Sep 17 00:00:00 2001 From: Matthias Date: Thu, 6 Aug 2020 09:00:28 +0200 Subject: [PATCH] Fix more tests --- tests/commands/test_commands.py | 5 ++--- tests/optimize/test_hyperopt.py | 4 +++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/commands/test_commands.py b/tests/commands/test_commands.py index 3ec7e4798..6837ebe98 100644 --- a/tests/commands/test_commands.py +++ b/tests/commands/test_commands.py @@ -667,7 +667,7 @@ def test_start_list_hyperopts(mocker, caplog, capsys): args = [ "list-hyperopts", "--hyperopt-path", - str(Path(__file__).parent.parent / "optimize"), + str(Path(__file__).parent.parent / "optimize" / "hyperopts"), "-1" ] pargs = get_args(args) @@ -683,7 +683,7 @@ def test_start_list_hyperopts(mocker, caplog, capsys): args = [ "list-hyperopts", "--hyperopt-path", - str(Path(__file__).parent.parent / "optimize"), + str(Path(__file__).parent.parent / "optimize" / "hyperopts"), ] pargs = get_args(args) # pargs['config'] = None @@ -692,7 +692,6 @@ def test_start_list_hyperopts(mocker, caplog, capsys): assert "TestHyperoptLegacy" not in captured.out assert "legacy_hyperopt.py" not in captured.out assert "DefaultHyperOpt" in captured.out - assert "test_hyperopt.py" in captured.out def test_start_test_pairlist(mocker, caplog, tickers, default_conf, capsys): diff --git a/tests/optimize/test_hyperopt.py b/tests/optimize/test_hyperopt.py index 2f9f9bc56..0d2ebf213 100644 --- a/tests/optimize/test_hyperopt.py +++ b/tests/optimize/test_hyperopt.py @@ -247,7 +247,7 @@ def test_hyperoptlossresolver_wrongname(default_conf) -> None: HyperOptLossResolver.load_hyperoptloss(default_conf) -def test_start_not_installed(mocker, default_conf) -> None: +def test_start_not_installed(mocker, default_conf, import_fails) -> None: start_mock = MagicMock() patched_configuration_load_config_file(mocker, default_conf) @@ -258,6 +258,8 @@ def test_start_not_installed(mocker, default_conf) -> None: 'hyperopt', '--config', 'config.json', '--hyperopt', 'DefaultHyperOpt', + '--hyperopt-path', + str(Path(__file__).parent / "hyperopts"), '--epochs', '5' ] pargs = get_args(args)