From 844df96ec77b7e9f28969627e26bc53253189f76 Mon Sep 17 00:00:00 2001 From: hoeckxer Date: Tue, 5 Jan 2021 07:06:53 +0100 Subject: [PATCH] Making changes so the build checks are satisified (imports & flake8) Signed-off-by: hoeckxer --- freqtrade/strategy/interface.py | 10 +++++++--- tests/strategy/test_interface.py | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/freqtrade/strategy/interface.py b/freqtrade/strategy/interface.py index 62ef4e91b..5f7ef8590 100644 --- a/freqtrade/strategy/interface.py +++ b/freqtrade/strategy/interface.py @@ -5,7 +5,7 @@ This module defines the interface to apply for strategies import logging import warnings from abc import ABC, abstractmethod -from datetime import datetime, timezone, timedelta +from datetime import datetime, timedelta, timezone from enum import Enum from typing import Dict, List, NamedTuple, Optional, Tuple @@ -487,11 +487,15 @@ class IStrategy(ABC): def ignore_expired_candle(self, dataframe: DataFrame, buy: bool): if self.ignore_buying_expired_candle and buy: - current_time = datetime.now(timezone.utc) - timedelta(seconds=self.ignore_buying_expired_candle_after) + current_time = datetime.now(timezone.utc) - timedelta( + seconds=self.ignore_buying_expired_candle_after) candle_time = dataframe['date'].tail(1).iat[0] time_delta = current_time - candle_time if time_delta.total_seconds() > self.ignore_buying_expired_candle_after: - logger.debug('ignoring buy signals because candle exceeded ignore_buying_expired_candle_after of %s seconds', self.ignore_buying_expired_candle_after) + logger.debug( + '''ignoring buy signals because candle exceeded + ignore_buying_expired_candle_after of %s seconds''', + self.ignore_buying_expired_candle_after) return True else: return False diff --git a/tests/strategy/test_interface.py b/tests/strategy/test_interface.py index 330689039..f389be45b 100644 --- a/tests/strategy/test_interface.py +++ b/tests/strategy/test_interface.py @@ -120,7 +120,7 @@ def test_ignore_expired_candle(default_conf, ohlcv_history): mocked_history.loc[1, 'buy'] = 1 mocked_history.loc[1, 'sell'] = 1 - assert strategy.ignore_expired_candle(mocked_history, True) == True + assert strategy.ignore_expired_candle(mocked_history, True) is True def test_assert_df_raise(mocker, caplog, ohlcv_history):