chore: remove rapidjson from "default" imports

This commit is contained in:
Matthias 2024-10-05 13:17:35 +02:00
parent 672a23dbcd
commit ed5c929b23
2 changed files with 3 additions and 3 deletions

View File

@ -3,8 +3,6 @@ import logging
import sys
from typing import Any, Dict, List, Union
import rapidjson
from freqtrade.enums import RunMode
from freqtrade.exceptions import ConfigurationError, OperationalException
from freqtrade.ft_types import ValidExchangesType
@ -297,6 +295,8 @@ def start_list_markets(args: Dict[str, Any], pairs_only: bool = False) -> None:
elif args.get("print_one_column", False):
print("\n".join(pairs.keys()))
elif args.get("list_pairs_print_json", False):
import rapidjson
print(rapidjson.dumps(list(pairs.keys()), default=str))
elif args.get("print_csv", False):
writer = csv.DictWriter(sys.stdout, fieldnames=headers)

View File

@ -146,7 +146,7 @@ def test_load_backtest_data_multi(testdatadir):
def test_load_trades_from_db(default_conf, fee, is_short, mocker):
create_mock_trades(fee, is_short)
# remove init so it does not init again
init_mock = mocker.patch("freqtrade.persistence.init_db", MagicMock())
init_mock = mocker.patch("freqtrade.data.btanalysis.init_db", MagicMock())
trades = load_trades_from_db(db_url=default_conf["db_url"])
assert init_mock.call_count == 1