Fixed flake8 warnings

This commit is contained in:
hoeckxer 2021-01-05 15:30:29 +01:00
parent 67d84e7514
commit 573de1cf08
2 changed files with 6 additions and 3 deletions

View File

@ -21,7 +21,6 @@ from freqtrade.persistence import PairLocks, Trade
from freqtrade.strategy.strategy_wrapper import strategy_safe_wrapper from freqtrade.strategy.strategy_wrapper import strategy_safe_wrapper
from freqtrade.wallets import Wallets from freqtrade.wallets import Wallets
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
@ -482,7 +481,9 @@ class IStrategy(ABC):
logger.debug('trigger: %s (pair=%s) buy=%s sell=%s', logger.debug('trigger: %s (pair=%s) buy=%s sell=%s',
latest['date'], pair, str(buy), str(sell)) latest['date'], pair, str(buy), str(sell))
timeframe_seconds = timeframe_to_seconds(timeframe) timeframe_seconds = timeframe_to_seconds(timeframe)
if self.ignore_expired_candle(latest_date=latest_date, timeframe_seconds=timeframe_seconds, buy=buy): if self.ignore_expired_candle(latest_date=latest_date,
timeframe_seconds=timeframe_seconds,
buy=buy):
return False, sell return False, sell
return buy, sell return buy, sell

View File

@ -117,7 +117,9 @@ def test_ignore_expired_candle(default_conf, ohlcv_history):
mocked_history = ohlcv_history.copy() mocked_history = ohlcv_history.copy()
latest_date = mocked_history['date'].max() latest_date = mocked_history['date'].max()
assert strategy.ignore_expired_candle(latest_date=latest_date, timeframe_seconds=300, buy=True) is True assert strategy.ignore_expired_candle(latest_date=latest_date,
timeframe_seconds=300,
buy=True) is True
def test_assert_df_raise(mocker, caplog, ohlcv_history): def test_assert_df_raise(mocker, caplog, ohlcv_history):