From 60cf52aa34c49a5a64b9c1da9335801b09e4d744 Mon Sep 17 00:00:00 2001 From: Matthias Date: Mon, 15 Nov 2021 07:09:21 +0100 Subject: [PATCH] Remove unused test code --- tests/conftest.py | 7 +------ tests/exchange/test_exchange.py | 9 --------- tests/test_freqtradebot.py | 8 -------- 3 files changed, 1 insertion(+), 23 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 751cb5f9f..3ce064ee3 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -16,7 +16,7 @@ from telegram import Chat, Message, Update from freqtrade import constants from freqtrade.commands import Arguments from freqtrade.data.converter import ohlcv_to_dataframe -from freqtrade.edge import Edge, PairInfo +from freqtrade.edge import PairInfo from freqtrade.enums import RunMode from freqtrade.exchange import Exchange from freqtrade.freqtradebot import FreqtradeBot @@ -140,11 +140,6 @@ def patch_edge(mocker) -> None: mocker.patch('freqtrade.edge.Edge.calculate', MagicMock(return_value=True)) -def get_patched_edge(mocker, config) -> Edge: - patch_edge(mocker) - edge = Edge(config) - return edge - # Functions for recurrent object patching diff --git a/tests/exchange/test_exchange.py b/tests/exchange/test_exchange.py index ced7d8d36..12b11ff3d 100644 --- a/tests/exchange/test_exchange.py +++ b/tests/exchange/test_exchange.py @@ -2017,15 +2017,6 @@ def test_get_sell_rate_exception(default_conf, mocker, caplog): assert exchange.get_rate(pair, refresh=True, side="sell") == 0.13 -def make_fetch_ohlcv_mock(data): - def fetch_ohlcv_mock(pair, timeframe, since): - if since: - assert since > data[-1][0] - return [] - return data - return fetch_ohlcv_mock - - @pytest.mark.parametrize("exchange_name", EXCHANGES) @pytest.mark.asyncio async def test___async_get_candle_history_sort(default_conf, mocker, exchange_name): diff --git a/tests/test_freqtradebot.py b/tests/test_freqtradebot.py index 629fed76b..e5dae5461 100644 --- a/tests/test_freqtradebot.py +++ b/tests/test_freqtradebot.py @@ -170,12 +170,8 @@ def test_edge_called_in_process(mocker, edge_conf) -> None: patch_RPCManager(mocker) patch_edge(mocker) - def _refresh_whitelist(list): - return ['ETH/USDT', 'LTC/BTC', 'XRP/BTC', 'NEO/BTC'] - patch_exchange(mocker) freqtrade = FreqtradeBot(edge_conf) - freqtrade.pairlists._validate_whitelist = _refresh_whitelist patch_get_signal(freqtrade) freqtrade.process() assert freqtrade.active_pair_whitelist == ['NEO/BTC', 'LTC/BTC'] @@ -664,9 +660,6 @@ def test_process_informative_pairs_added(default_conf_usdt, ticker_usdt, mocker) patch_RPCManager(mocker) patch_exchange(mocker) - def _refresh_whitelist(list): - return ['ETH/USDT', 'LTC/BTC', 'XRP/BTC', 'NEO/BTC'] - refresh_mock = MagicMock() mocker.patch.multiple( 'freqtrade.exchange.Exchange', @@ -682,7 +675,6 @@ def test_process_informative_pairs_added(default_conf_usdt, ticker_usdt, mocker) mocker.patch('time.sleep', return_value=None) freqtrade = FreqtradeBot(default_conf_usdt) - freqtrade.pairlists._validate_whitelist = _refresh_whitelist freqtrade.strategy.informative_pairs = inf_pairs # patch_get_signal(freqtrade)