call bot_loop_start() in backtesting to allow setup-code to run

This commit is contained in:
Matthias
2020-10-11 19:50:37 +02:00
parent baa1142afa
commit 9147106259
3 changed files with 8 additions and 2 deletions

View File

@@ -350,6 +350,7 @@ def test_backtesting_start(default_conf, mocker, testdatadir, caplog) -> None:
default_conf['timerange'] = '-1510694220'
backtesting = Backtesting(default_conf)
backtesting.strategy.bot_loop_start = MagicMock()
backtesting.start()
# check the logs, that will contain the backtest result
exists = [
@@ -359,6 +360,7 @@ def test_backtesting_start(default_conf, mocker, testdatadir, caplog) -> None:
for line in exists:
assert log_has(line, caplog)
assert backtesting.strategy.dp._pairlists is not None
assert backtesting.strategy.bot_loop_start.call_count == 1
def test_backtesting_start_no_data(default_conf, mocker, caplog, testdatadir) -> None: