Simplify conftest setup (1000 fewer lines!)
default hyperopt results demo should not be a fixture (it's only used in one place)
This commit is contained in:
@@ -54,6 +54,7 @@ from tests.conftest import (
|
|||||||
patch_exchange,
|
patch_exchange,
|
||||||
patched_configuration_load_config_file,
|
patched_configuration_load_config_file,
|
||||||
)
|
)
|
||||||
|
from tests.conftest_hyperopt import hyperopt_test_result
|
||||||
from tests.conftest_trades import MOCK_TRADE_COUNT
|
from tests.conftest_trades import MOCK_TRADE_COUNT
|
||||||
|
|
||||||
|
|
||||||
@@ -1137,7 +1138,8 @@ def test_start_test_pairlist(mocker, caplog, tickers, default_conf, capsys):
|
|||||||
pytest.fail(f"Expected well formed JSON, but failed to parse: {captured.out}")
|
pytest.fail(f"Expected well formed JSON, but failed to parse: {captured.out}")
|
||||||
|
|
||||||
|
|
||||||
def test_hyperopt_list(mocker, capsys, caplog, saved_hyperopt_results, tmp_path):
|
def test_hyperopt_list(mocker, capsys, caplog, tmp_path):
|
||||||
|
saved_hyperopt_results = hyperopt_test_result()
|
||||||
csv_file = tmp_path / "test.csv"
|
csv_file = tmp_path / "test.csv"
|
||||||
mocker.patch(
|
mocker.patch(
|
||||||
"freqtrade.optimize.hyperopt_tools.HyperoptTools._test_hyperopt_results_exist",
|
"freqtrade.optimize.hyperopt_tools.HyperoptTools._test_hyperopt_results_exist",
|
||||||
@@ -1507,7 +1509,8 @@ def test_hyperopt_list(mocker, capsys, caplog, saved_hyperopt_results, tmp_path)
|
|||||||
csv_file.unlink()
|
csv_file.unlink()
|
||||||
|
|
||||||
|
|
||||||
def test_hyperopt_show(mocker, capsys, saved_hyperopt_results):
|
def test_hyperopt_show(mocker, capsys):
|
||||||
|
saved_hyperopt_results = hyperopt_test_result()
|
||||||
mocker.patch(
|
mocker.patch(
|
||||||
"freqtrade.optimize.hyperopt_tools.HyperoptTools._test_hyperopt_results_exist",
|
"freqtrade.optimize.hyperopt_tools.HyperoptTools._test_hyperopt_results_exist",
|
||||||
return_value=True,
|
return_value=True,
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user