test_refresh_latest_trades: mock datadir with tmp_path

This commit is contained in:
Joe Schr
2024-05-15 16:19:36 +02:00
parent f87cd5daca
commit 6c696e14f0

View File

@@ -2374,7 +2374,7 @@ def test_refresh_latest_ohlcv(mocker, default_conf, caplog, candle_type) -> None
@pytest.mark.parametrize("candle_type", [CandleType.FUTURES, CandleType.MARK, CandleType.SPOT])
def test_refresh_latest_trades(mocker, default_conf, caplog, candle_type) -> None:
def test_refresh_latest_trades(mocker, default_conf, caplog, candle_type, tmp_path) -> None:
# TODO: mock cached trades
trades = [
{
@@ -2409,6 +2409,7 @@ def test_refresh_latest_trades(mocker, default_conf, caplog, candle_type) -> Non
caplog.set_level(logging.DEBUG)
use_trades_conf = default_conf
use_trades_conf["exchange"]["use_public_trades"] = True
use_trades_conf["datadir"] = tmp_path
exchange = get_patched_exchange(mocker, use_trades_conf)
exchange._api_async.fetch_trades = get_mock_coro(trades)
exchange._ft_has["exchange_has_overrides"]["fetchTrades"] = True