Flake8 compatibility
This commit is contained in:
@@ -1,30 +1,15 @@
|
||||
# pragma pylint: disable=missing-docstring, W0212, line-too-long, C0103, unused-argument
|
||||
|
||||
import random
|
||||
from datetime import datetime, timedelta, timezone
|
||||
from pathlib import Path
|
||||
from unittest.mock import MagicMock, PropertyMock
|
||||
import logging
|
||||
|
||||
import numpy as np
|
||||
import pandas as pd
|
||||
import pytest
|
||||
from arrow import Arrow
|
||||
|
||||
from freqtrade.commands.optimize_commands import setup_optimize_configuration, start_backtesting
|
||||
from freqtrade.configuration import TimeRange
|
||||
from freqtrade.data import history
|
||||
from freqtrade.data.btanalysis import BT_DATA_COLUMNS, evaluate_result_multi
|
||||
from freqtrade.data.converter import clean_ohlcv_dataframe
|
||||
from freqtrade.data.dataprovider import DataProvider
|
||||
from freqtrade.data.history import get_timerange
|
||||
from freqtrade.enums import RunMode, SellType
|
||||
from freqtrade.exceptions import DependencyException, OperationalException
|
||||
from freqtrade.enums import SellType
|
||||
from freqtrade.optimize.backtesting import Backtesting
|
||||
from freqtrade.persistence import LocalTrade
|
||||
from freqtrade.resolvers import StrategyResolver
|
||||
from tests.conftest import (get_args, log_has, log_has_re, patch_exchange,
|
||||
patched_configuration_load_config_file)
|
||||
from tests.conftest import (patch_exchange)
|
||||
|
||||
|
||||
def test_backtest_position_adjustment(default_conf, fee, mocker, testdatadir) -> None:
|
||||
default_conf['use_sell_signal'] = False
|
||||
|
@@ -8,6 +8,7 @@ from freqtrade.strategy.interface import IStrategy
|
||||
from freqtrade.persistence import Trade
|
||||
from datetime import datetime
|
||||
|
||||
|
||||
class StrategyTestV2(IStrategy):
|
||||
"""
|
||||
Strategy used by tests freqtrade bot.
|
||||
@@ -163,7 +164,7 @@ class StrategyTestV2(IStrategy):
|
||||
for order in trade.orders:
|
||||
if order.ft_is_open:
|
||||
return None
|
||||
|
||||
|
||||
return self.wallets.get_trade_stake_amount(pair, None)
|
||||
|
||||
return None
|
||||
|
@@ -1506,6 +1506,7 @@ def test_recalc_trade_from_orders(fee):
|
||||
assert pytest.approx(trade.fee_open_cost) == o1_fee_cost + o2_fee_cost + o3_fee_cost
|
||||
assert pytest.approx(trade.open_trade_value) == o1_trade_val + o2_trade_val + o3_trade_val
|
||||
|
||||
|
||||
def test_recalc_trade_from_orders_ignores_bad_orders(fee):
|
||||
|
||||
o1_amount = 100
|
||||
@@ -1631,6 +1632,3 @@ def test_recalc_trade_from_orders_ignores_bad_orders(fee):
|
||||
assert trade.open_rate == o1_rate
|
||||
assert trade.fee_open_cost == o1_fee_cost
|
||||
assert trade.open_trade_value == o1_trade_val
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user