Flake8 fixes
This commit is contained in:
parent
1cfa0a3c0e
commit
94287d66a8
@ -350,4 +350,3 @@ def get_fee(symbol='ETH/BTC', type='', side='', amount=1,
|
||||
|
||||
return _API.calculate_fee(symbol=symbol, type=type, side=side, amount=amount,
|
||||
price=price, takerOrMaker=taker_or_maker)['rate']
|
||||
|
||||
|
@ -6,13 +6,11 @@ This module contains the backtesting logic
|
||||
from argparse import Namespace
|
||||
from typing import Dict, Tuple, Any, List, Optional
|
||||
|
||||
import ccxt
|
||||
import arrow
|
||||
from pandas import DataFrame, Series
|
||||
from tabulate import tabulate
|
||||
|
||||
import freqtrade.optimize as optimize
|
||||
import freqtrade.exchange as exchange
|
||||
from freqtrade import exchange
|
||||
from freqtrade.analyze import Analyze
|
||||
from freqtrade.arguments import Arguments
|
||||
|
@ -108,6 +108,7 @@ def test_validate_pairs_stake_exception(default_conf, mocker, caplog):
|
||||
):
|
||||
validate_pairs(default_conf['exchange']['pair_whitelist'])
|
||||
|
||||
|
||||
def test_buy_dry_run(default_conf, mocker):
|
||||
default_conf['dry_run'] = True
|
||||
mocker.patch.dict('freqtrade.exchange._CONF', default_conf)
|
||||
@ -116,6 +117,7 @@ def test_buy_dry_run(default_conf, mocker):
|
||||
assert 'id' in order
|
||||
assert 'dry_run_buy_' in order['id']
|
||||
|
||||
|
||||
def test_buy_prod(default_conf, mocker):
|
||||
api_mock = MagicMock()
|
||||
order_id = 'test_prod_buy_{}'.format(randint(0, 10 ** 6))
|
||||
|
@ -16,7 +16,7 @@ from freqtrade import optimize
|
||||
from freqtrade.analyze import Analyze
|
||||
from freqtrade.arguments import Arguments
|
||||
from freqtrade.optimize.backtesting import Backtesting, start, setup_configuration
|
||||
from freqtrade.tests.conftest import default_conf, log_has
|
||||
from freqtrade.tests.conftest import log_has
|
||||
|
||||
# Avoid to reinit the same object again and again
|
||||
_BACKTESTING = None
|
||||
@ -45,7 +45,8 @@ def trim_dictlist(dict_list, num):
|
||||
|
||||
def load_data_test(what):
|
||||
timerange = ((None, 'line'), None, -100)
|
||||
data = optimize.load_data(None, ticker_interval='1m', pairs=['UNITTEST/BTC'], timerange=timerange)
|
||||
data = optimize.load_data(None, ticker_interval='1m',
|
||||
pairs=['UNITTEST/BTC'], timerange=timerange)
|
||||
pair = data['UNITTEST/BTC']
|
||||
datalen = len(pair)
|
||||
# Depending on the what parameter we now adjust the
|
||||
|
@ -1,5 +1,4 @@
|
||||
# pragma pylint: disable=missing-docstring,W0212,C0103
|
||||
import json
|
||||
import os
|
||||
import signal
|
||||
from copy import deepcopy
|
||||
@ -25,7 +24,8 @@ def init_hyperopt(default_conf, mocker):
|
||||
global _HYPEROPT_INITIALIZED, _HYPEROPT
|
||||
if not _HYPEROPT_INITIALIZED:
|
||||
mocker.patch('freqtrade.exchange.validate_pairs', MagicMock(return_value=True))
|
||||
mocker.patch('freqtrade.optimize.hyperopt.hyperopt_optimize_conf', MagicMock(return_value=default_conf))
|
||||
mocker.patch('freqtrade.optimize.hyperopt.hyperopt_optimize_conf',
|
||||
MagicMock(return_value=default_conf))
|
||||
mocker.patch('freqtrade.exchange.validate_pairs', MagicMock())
|
||||
_HYPEROPT = Hyperopt(default_conf)
|
||||
_HYPEROPT_INITIALIZED = True
|
||||
@ -66,7 +66,8 @@ def test_start(mocker, default_conf, caplog) -> None:
|
||||
start_mock = MagicMock()
|
||||
mocker.patch('freqtrade.logger.Logger.set_format', MagicMock())
|
||||
mocker.patch('freqtrade.optimize.hyperopt.Hyperopt.start', start_mock)
|
||||
mocker.patch('freqtrade.optimize.hyperopt.hyperopt_optimize_conf', MagicMock(return_value=default_conf))
|
||||
mocker.patch('freqtrade.optimize.hyperopt.hyperopt_optimize_conf',
|
||||
MagicMock(return_value=default_conf))
|
||||
mocker.patch('freqtrade.freqtradebot.exchange.validate_pairs', MagicMock())
|
||||
|
||||
args = [
|
||||
|
Loading…
Reference in New Issue
Block a user