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:
Matthias 2024-05-19 18:11:25 +02:00
parent cdf42604ce
commit e49fec5533
3 changed files with 1005 additions and 1000 deletions

View File

@ -54,6 +54,7 @@ from tests.conftest import (
patch_exchange,
patched_configuration_load_config_file,
)
from tests.conftest_hyperopt import hyperopt_test_result
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}")
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"
mocker.patch(
"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()
def test_hyperopt_show(mocker, capsys, saved_hyperopt_results):
def test_hyperopt_show(mocker, capsys):
saved_hyperopt_results = hyperopt_test_result()
mocker.patch(
"freqtrade.optimize.hyperopt_tools.HyperoptTools._test_hyperopt_results_exist",
return_value=True,

File diff suppressed because it is too large Load Diff

1000
tests/conftest_hyperopt.py Normal file

File diff suppressed because it is too large Load Diff