mirror of
https://github.com/freqtrade/freqtrade.git
synced 2026-01-26 00:40:23 +00:00
test: adjust test for raise-exception behavior
This commit is contained in:
@@ -2177,13 +2177,11 @@ def test_get_historic_ohlcv(default_conf, mocker, caplog, exchange_name, candle_
|
|||||||
|
|
||||||
caplog.clear()
|
caplog.clear()
|
||||||
|
|
||||||
async def mock_get_candle_hist_error(pair, *args, **kwargs):
|
exchange._async_get_candle_history = get_mock_coro(side_effect=TimeoutError)
|
||||||
raise TimeoutError()
|
with pytest.raises(TimeoutError):
|
||||||
|
exchange.get_historic_ohlcv(
|
||||||
exchange._async_get_candle_history = MagicMock(side_effect=mock_get_candle_hist_error)
|
pair, "5m", dt_ts(dt_now() - timedelta(seconds=since)), candle_type=candle_type
|
||||||
ret = exchange.get_historic_ohlcv(
|
)
|
||||||
pair, "5m", dt_ts(dt_now() - timedelta(seconds=since)), candle_type=candle_type
|
|
||||||
)
|
|
||||||
assert log_has_re(r"Async code raised an exception: .*", caplog)
|
assert log_has_re(r"Async code raised an exception: .*", caplog)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user