optimize imports

This commit is contained in:
gcarq
2018-03-17 22:44:47 +01:00
parent d8689e5045
commit d2aea7bdc1
36 changed files with 101 additions and 69 deletions

View File

@@ -1,14 +1,15 @@
# pragma pylint: disable=missing-docstring
from datetime import datetime
from unittest.mock import MagicMock
from functools import reduce
import logging
import json
import logging
from datetime import datetime
from functools import reduce
from unittest.mock import MagicMock
import arrow
import pytest
from jsonschema import validate
from telegram import Chat, Message, Update
from sqlalchemy import create_engine
from telegram import Chat, Message, Update
from freqtrade.analyze import Analyze
from freqtrade.constants import Constants

View File

@@ -1,15 +1,16 @@
# pragma pylint: disable=missing-docstring, C0103, bad-continuation, global-statement
# pragma pylint: disable=protected-access
from unittest.mock import MagicMock
from random import randint
import logging
from requests.exceptions import RequestException
import pytest
from random import randint
from unittest.mock import MagicMock
import pytest
from requests.exceptions import RequestException
import freqtrade.exchange as exchange
from freqtrade import OperationalException
from freqtrade.exchange import init, validate_pairs, buy, sell, get_balance, get_balances, \
get_ticker, get_ticker_history, cancel_order, get_name, get_fee
import freqtrade.exchange as exchange
from freqtrade.tests.conftest import log_has
API_INIT = False

View File

@@ -1,10 +1,12 @@
# pragma pylint: disable=missing-docstring, C0103, protected-access, unused-argument
from unittest.mock import MagicMock
import pytest
from requests.exceptions import ContentDecodingError
from freqtrade.exchange.bittrex import Bittrex
import freqtrade.exchange.bittrex as btx
from freqtrade.exchange.bittrex import Bittrex
# Eat this flake8

View File

@@ -1,20 +1,21 @@
# pragma pylint: disable=missing-docstring, W0212, line-too-long, C0103, unused-argument
import json
import random
import math
from typing import List
import random
from copy import deepcopy
from typing import List
from unittest.mock import MagicMock
from arrow import Arrow
import pandas as pd
import numpy as np
from freqtrade import optimize
from freqtrade.optimize.backtesting import Backtesting, start, setup_configuration
from freqtrade.arguments import Arguments
from freqtrade.analyze import Analyze
from freqtrade.tests.conftest import default_conf, log_has
import numpy as np
import pandas as pd
from arrow import Arrow
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
# Avoid to reinit the same object again and again
_BACKTESTING = Backtesting(default_conf())

View File

@@ -3,6 +3,7 @@ import json
import os
from copy import deepcopy
from unittest.mock import MagicMock
import pandas as pd
from freqtrade.optimize.__init__ import load_tickerdata_file

View File

@@ -1,13 +1,14 @@
# pragma pylint: disable=missing-docstring, protected-access, C0103
import os
import json
import os
import uuid
from shutil import copyfile
from freqtrade import optimize
from freqtrade.optimize.__init__ import make_testdata_path, download_pairs,\
download_backtesting_testdata, load_tickerdata_file, trim_tickerlist
from freqtrade.misc import file_dump_json
from freqtrade.optimize.__init__ import make_testdata_path, download_pairs, \
download_backtesting_testdata, load_tickerdata_file, trim_tickerlist
from freqtrade.tests.conftest import log_has
# Change this if modifying BTC_UNITEST testdatafile

View File

@@ -6,23 +6,23 @@ Unit test file for rpc/telegram.py
"""
import re
from copy import deepcopy
from datetime import datetime
from random import randint
from unittest.mock import MagicMock
from copy import deepcopy
from sqlalchemy import create_engine
from telegram import Update, Message, Chat
from telegram.error import NetworkError
from freqtrade import __version__
from freqtrade.rpc.telegram import authorized_only
from freqtrade.freqtradebot import FreqtradeBot
from freqtrade.rpc.telegram import Telegram
from freqtrade.persistence import Trade
from freqtrade.rpc.telegram import Telegram
from freqtrade.rpc.telegram import authorized_only
from freqtrade.state import State
from freqtrade.tests.test_freqtradebot import patch_get_signal, patch_coinmarketcap
from freqtrade.tests.conftest import get_patched_freqtradebot, log_has
from freqtrade.tests.test_freqtradebot import patch_get_signal, patch_coinmarketcap
class DummyCls(Telegram):

View File

@@ -1,8 +1,10 @@
import json
import pytest
from pandas import DataFrame
from freqtrade.strategy.default_strategy import DefaultStrategy, class_name
from freqtrade.analyze import Analyze
from freqtrade.strategy.default_strategy import DefaultStrategy, class_name
@pytest.fixture

View File

@@ -1,6 +1,7 @@
# pragma pylint: disable=missing-docstring, protected-access, C0103
import logging
from freqtrade.strategy.strategy import Strategy

View File

@@ -5,8 +5,9 @@ Unit test file for analyse.py
"""
import datetime
from unittest.mock import MagicMock
import logging
from unittest.mock import MagicMock
import arrow
from pandas import DataFrame
@@ -14,7 +15,6 @@ from freqtrade.analyze import Analyze, SignalType
from freqtrade.optimize.__init__ import load_tickerdata_file
from freqtrade.tests.conftest import log_has
# Avoid to reinit the same object again and again
_ANALYZE = Analyze({'strategy': 'default_strategy'})

View File

@@ -6,6 +6,7 @@ Unit test file for arguments.py
import argparse
import logging
import pytest
from freqtrade.arguments import Arguments

View File

@@ -4,10 +4,10 @@
Unit test file for configuration.py
"""
import json
from copy import deepcopy
import pytest
from unittest.mock import MagicMock
import pytest
from jsonschema import ValidationError
from freqtrade.arguments import Arguments

View File

@@ -2,8 +2,8 @@
import pandas
from freqtrade.optimize import load_data
from freqtrade.analyze import Analyze
from freqtrade.optimize import load_data
from freqtrade.strategy.strategy import Strategy
_pairs = ['BTC_ETH']

View File

@@ -5,22 +5,23 @@ Unit test file for freqtradebot.py
"""
import logging
import re
import time
from unittest.mock import MagicMock
from copy import deepcopy
from typing import Dict, Optional
from unittest.mock import MagicMock
import arrow
import pytest
import requests
import re
from sqlalchemy import create_engine
from freqtrade.tests.conftest import log_has
from freqtrade import DependencyException, OperationalException
from freqtrade.exchange import Exchanges
from freqtrade.freqtradebot import FreqtradeBot
from freqtrade.state import State
from freqtrade.persistence import Trade
from freqtrade.state import State
from freqtrade.tests.conftest import log_has
# Functions for recurrent object patching

View File

@@ -1,4 +1,5 @@
import pandas as pd
from freqtrade.indicator_helpers import went_up, went_down

View File

@@ -3,6 +3,7 @@ Unit test file for logger.py
"""
import logging
from freqtrade.logger import Logger

View File

@@ -4,6 +4,7 @@ Unit test file for main.py
import logging
from unittest.mock import MagicMock
import pytest
from freqtrade.main import main, set_loggers

View File

@@ -6,10 +6,11 @@ Unit test file for misc.py
import datetime
from unittest.mock import MagicMock
from freqtrade.analyze import Analyze
from freqtrade.optimize.__init__ import load_tickerdata_file
from freqtrade.misc import (shorten_date, datesarray_to_datetimearray,
common_datearray, file_dump_json)
from freqtrade.optimize.__init__ import load_tickerdata_file
def test_shorten_date() -> None:

View File

@@ -1,7 +1,9 @@
# pragma pylint: disable=missing-docstring, C0103
import os
import pytest
from sqlalchemy import create_engine
from freqtrade.exchange import Exchanges
from freqtrade.persistence import Trade, init, clean_dry_run_db

View File

@@ -1,12 +1,12 @@
#!/usr/bin/env python3
"""This script generate json data from bittrex"""
import sys
import json
import sys
from freqtrade import exchange
from freqtrade.exchange import Bittrex
from freqtrade import misc
from freqtrade.exchange import Bittrex
parser = misc.common_args_parser('download utility')
parser.add_argument(