From 502c69dce3b2e9b8d95e87bc293948165b5e34fc Mon Sep 17 00:00:00 2001 From: kevinjulian Date: Tue, 6 Jul 2021 19:36:42 +0700 Subject: [PATCH] change short desc --- freqtrade/plugins/pairlist/AgeFilter.py | 24 +++++++++++++++--------- tests/plugins/test_pairlist.py | 2 +- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/freqtrade/plugins/pairlist/AgeFilter.py b/freqtrade/plugins/pairlist/AgeFilter.py index ef3953776..c482f6217 100644 --- a/freqtrade/plugins/pairlist/AgeFilter.py +++ b/freqtrade/plugins/pairlist/AgeFilter.py @@ -55,10 +55,13 @@ class AgeFilter(IPairList): """ Short whitelist method description - used for startup-messages """ - return (f"{self.name} - Filtering pairs with age less than " - f"{self._min_days_listed} {plural(self._min_days_listed, 'day')}" - " or more than " - f"{self._max_days_listed} {plural(self._max_days_listed, 'day')}") + return ( + f"{self.name} - Filtering pairs with age less than " + f"{self._min_days_listed} {plural(self._min_days_listed, 'day')}" + ) + ( + " or more than " + f"{self._max_days_listed} {plural(self._max_days_listed, 'day')}" + ) if self._max_days_listed else '' def filter_pairlist(self, pairlist: List[str], tickers: Dict) -> List[str]: """ @@ -105,10 +108,13 @@ class AgeFilter(IPairList): self._symbolsChecked[pair] = int(arrow.utcnow().float_timestamp) * 1000 return True else: - self.log_once(f"Removed {pair} from whitelist, because age " - f"{len(daily_candles)} is less than {self._min_days_listed} " - f"{plural(self._min_days_listed, 'day')} or more than " - f"{self._max_days_listed} {plural(self._max_days_listed, 'day')}", - logger.info) + self.log_once(( + f"Removed {pair} from whitelist, because age " + f"{len(daily_candles)} is less than {self._min_days_listed} " + f"{plural(self._min_days_listed, 'day')}" + ) + ( + " or more than " + f"{self._max_days_listed} {plural(self._max_days_listed, 'day')}" + ) if self.max_days_listed else '', logger.info) return False return False diff --git a/tests/plugins/test_pairlist.py b/tests/plugins/test_pairlist.py index 03d8fc563..5724ca39c 100644 --- a/tests/plugins/test_pairlist.py +++ b/tests/plugins/test_pairlist.py @@ -487,7 +487,7 @@ def test_VolumePairList_whitelist_gen(mocker, whitelist_conf, shitcoinmarkets, t if pairlist['method'] == 'AgeFilter' and pairlist['min_days_listed'] and \ len(ohlcv_history) < pairlist['min_days_listed']: assert log_has_re(r'^Removed .* from whitelist, because age .* is less than ' - r'.* day.* or more than .* day', caplog) + r'.* day.*', caplog) if pairlist['method'] == 'AgeFilter' and pairlist['max_days_listed'] and \ len(ohlcv_history) > pairlist['max_days_listed']: assert log_has_re(r'^Removed .* from whitelist, because age .* is less than '