From 208832e8471faed4427155c5b6817a6f8295aab8 Mon Sep 17 00:00:00 2001 From: hroff-1902 Date: Sat, 30 Mar 2019 02:19:43 +0300 Subject: [PATCH] flake8, mypy resolved --- freqtrade/tests/rpc/test_rpc_telegram.py | 1 - freqtrade/tests/test_main.py | 11 ++++++++--- freqtrade/worker.py | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/freqtrade/tests/rpc/test_rpc_telegram.py b/freqtrade/tests/rpc/test_rpc_telegram.py index b44c19688..384cdcfa0 100644 --- a/freqtrade/tests/rpc/test_rpc_telegram.py +++ b/freqtrade/tests/rpc/test_rpc_telegram.py @@ -14,7 +14,6 @@ from telegram.error import NetworkError from freqtrade import __version__ from freqtrade.edge import PairInfo -from freqtrade.freqtradebot import FreqtradeBot from freqtrade.persistence import Trade from freqtrade.rpc import RPCMessageType from freqtrade.rpc.telegram import Telegram, authorized_only diff --git a/freqtrade/tests/test_main.py b/freqtrade/tests/test_main.py index 96cf2834d..fc5d2e378 100644 --- a/freqtrade/tests/test_main.py +++ b/freqtrade/tests/test_main.py @@ -8,7 +8,6 @@ import pytest from freqtrade import OperationalException from freqtrade.arguments import Arguments from freqtrade.worker import Worker -from freqtrade.freqtradebot import FreqtradeBot from freqtrade.main import main from freqtrade.state import State from freqtrade.tests.conftest import log_has, patch_exchange @@ -85,7 +84,10 @@ def test_main_keyboard_interrupt(mocker, default_conf, caplog) -> None: def test_main_operational_exception(mocker, default_conf, caplog) -> None: patch_exchange(mocker) mocker.patch('freqtrade.freqtradebot.FreqtradeBot.cleanup', MagicMock()) - mocker.patch('freqtrade.worker.Worker._worker', MagicMock(side_effect=OperationalException('Oh snap!'))) + mocker.patch( + 'freqtrade.worker.Worker._worker', + MagicMock(side_effect=OperationalException('Oh snap!')) + ) mocker.patch( 'freqtrade.configuration.Configuration._load_config_file', lambda *args, **kwargs: default_conf @@ -128,7 +130,10 @@ def test_main_reload_conf(mocker, default_conf, caplog) -> None: def test_reconfigure(mocker, default_conf) -> None: patch_exchange(mocker) mocker.patch('freqtrade.freqtradebot.FreqtradeBot.cleanup', MagicMock()) - mocker.patch('freqtrade.worker.Worker._worker', MagicMock(side_effect=OperationalException('Oh snap!'))) + mocker.patch( + 'freqtrade.worker.Worker._worker', + MagicMock(side_effect=OperationalException('Oh snap!')) + ) mocker.patch( 'freqtrade.configuration.Configuration._load_config_file', lambda *args, **kwargs: default_conf diff --git a/freqtrade/worker.py b/freqtrade/worker.py index a6fba1460..f32e6ff49 100755 --- a/freqtrade/worker.py +++ b/freqtrade/worker.py @@ -23,7 +23,7 @@ class Worker(object): Freqtradebot worker class """ - def __init__(self, args: Optional[Namespace] = None, config = None) -> None: + def __init__(self, args: Namespace, config=None) -> None: """ Init all variables and objects the bot needs to work """