test: update tests for new error formatting

This commit is contained in:
Matthias
2025-10-25 13:15:41 +02:00
parent 75c39d3617
commit c18a52fd2d

View File

@@ -147,14 +147,14 @@ def test_get_signal_exception_valueerror(mocker, caplog, ohlcv_history):
mocker.patch.object(_STRATEGY.dp, "ohlcv", return_value=ohlcv_history)
mocker.patch.object(_STRATEGY, "_analyze_ticker_internal", side_effect=ValueError("xyz"))
_STRATEGY.analyze_pair("foo")
assert log_has_re(r"Strategy caused the following exception: xyz.*", caplog)
assert log_has_re(r"Strategy caused the following exception: ValueError\('xyz'\).*", caplog)
caplog.clear()
mocker.patch.object(
_STRATEGY, "analyze_ticker", side_effect=Exception("invalid ticker history ")
)
_STRATEGY.analyze_pair("foo")
assert log_has_re(r"Strategy caused the following exception: xyz.*", caplog)
assert log_has_re(r"Strategy caused the following exception: ValueError\('xyz'\).*", caplog)
def test_get_signal_old_dataframe(default_conf, mocker, caplog, ohlcv_history):