diff --git a/freqtrade/exchange/exchange.py b/freqtrade/exchange/exchange.py index 30bf9a30c..272d81e59 100644 --- a/freqtrade/exchange/exchange.py +++ b/freqtrade/exchange/exchange.py @@ -680,10 +680,6 @@ class Exchange(object): except ccxt.BaseError as e: raise OperationalException(e) - @retrier - def get_markets(self) -> List[dict]: - return list(self.markets.values()) - @retrier def get_fee(self, symbol='ETH/BTC', type='', side='', amount=1, price=1, taker_or_maker='maker') -> float: diff --git a/freqtrade/tests/exchange/test_exchange.py b/freqtrade/tests/exchange/test_exchange.py index 0beea4ed3..e9debbfc2 100644 --- a/freqtrade/tests/exchange/test_exchange.py +++ b/freqtrade/tests/exchange/test_exchange.py @@ -1303,19 +1303,6 @@ def test_get_trades_for_order(default_conf, mocker, exchange_name): assert exchange.get_trades_for_order(order_id, 'LTC/BTC', since) == [] -@pytest.mark.parametrize("exchange_name", EXCHANGES) -def test_get_markets(default_conf, mocker, markets, exchange_name): - mocker.patch('freqtrade.exchange.Exchange.validate_pairs', MagicMock()) - mocker.patch('freqtrade.exchange.Exchange.markets', PropertyMock(return_value=markets)) - exchange = get_patched_exchange(mocker, default_conf, id=exchange_name) - ret = exchange.get_markets() - assert isinstance(ret, list) - assert len(ret) == 9 - - assert ret[0]["id"] == "ethbtc" - assert ret[0]["symbol"] == "ETH/BTC" - - @pytest.mark.parametrize("exchange_name", EXCHANGES) def test_get_fee(default_conf, mocker, exchange_name): api_mock = MagicMock() diff --git a/freqtrade/tests/pairlist/test_pairlist.py b/freqtrade/tests/pairlist/test_pairlist.py index c40e16f77..52f44c41b 100644 --- a/freqtrade/tests/pairlist/test_pairlist.py +++ b/freqtrade/tests/pairlist/test_pairlist.py @@ -33,7 +33,7 @@ def whitelist_conf(default_conf): def test_load_pairlist_noexist(mocker, markets, default_conf): freqtradebot = get_patched_freqtradebot(mocker, default_conf) - mocker.patch('freqtrade.exchange.Exchange.get_markets', markets) + mocker.patch('freqtrade.exchange.Exchange.markets', PropertyMock(return_value=markets)) with pytest.raises(ImportError, match=r"Impossible to load Pairlist 'NonexistingPairList'." r" This class does not exist or contains Python code errors"): diff --git a/freqtrade/tests/rpc/test_rpc_telegram.py b/freqtrade/tests/rpc/test_rpc_telegram.py index b5055d7f5..02f4f4afb 100644 --- a/freqtrade/tests/rpc/test_rpc_telegram.py +++ b/freqtrade/tests/rpc/test_rpc_telegram.py @@ -232,7 +232,7 @@ def test_status_handle(default_conf, update, ticker, fee, markets, mocker) -> No 'freqtrade.exchange.Exchange', get_ticker=ticker, get_fee=fee, - get_markets=markets + markets=PropertyMock(markets) ) msg_mock = MagicMock() status_table = MagicMock() @@ -279,7 +279,7 @@ def test_status_table_handle(default_conf, update, ticker, fee, markets, mocker) get_ticker=ticker, buy=MagicMock(return_value={'id': 'mocked_order_id'}), get_fee=fee, - get_markets=markets + markets=PropertyMock(markets) ) msg_mock = MagicMock() mocker.patch.multiple( @@ -334,7 +334,7 @@ def test_daily_handle(default_conf, update, ticker, limit_buy_order, fee, 'freqtrade.exchange.Exchange', get_ticker=ticker, get_fee=fee, - get_markets=markets + markets=PropertyMock(markets) ) msg_mock = MagicMock() mocker.patch.multiple( @@ -438,7 +438,7 @@ def test_profit_handle(default_conf, update, ticker, ticker_sell_up, fee, 'freqtrade.exchange.Exchange', get_ticker=ticker, get_fee=fee, - get_markets=markets + markets=PropertyMock(markets) ) msg_mock = MagicMock() mocker.patch.multiple(