mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-10 10:21:59 +00:00
Move get_args from multiple locations to conftest
This commit is contained in:
parent
09cd7db9b1
commit
e6cab6d710
|
@ -4,6 +4,7 @@ import logging
|
|||
import re
|
||||
from datetime import datetime
|
||||
from functools import reduce
|
||||
from typing import List
|
||||
from unittest.mock import MagicMock, PropertyMock
|
||||
|
||||
import arrow
|
||||
|
@ -11,6 +12,7 @@ import pytest
|
|||
from telegram import Chat, Message, Update
|
||||
|
||||
from freqtrade import constants, persistence
|
||||
from freqtrade.arguments import Arguments
|
||||
from freqtrade.data.converter import parse_ticker_dataframe
|
||||
from freqtrade.edge import Edge, PairInfo
|
||||
from freqtrade.exchange import Exchange
|
||||
|
@ -35,6 +37,10 @@ def log_has_re(line, logs):
|
|||
False)
|
||||
|
||||
|
||||
def get_args(args) -> List[str]:
|
||||
return Arguments(args, '').get_parsed_arg()
|
||||
|
||||
|
||||
def patch_exchange(mocker, api_mock=None, id='bittrex') -> None:
|
||||
mocker.patch('freqtrade.exchange.Exchange._load_markets', MagicMock(return_value={}))
|
||||
mocker.patch('freqtrade.exchange.Exchange.validate_pairs', MagicMock())
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
import json
|
||||
import math
|
||||
import random
|
||||
from typing import List
|
||||
from unittest.mock import MagicMock
|
||||
|
||||
import numpy as np
|
||||
|
@ -12,7 +11,7 @@ import pytest
|
|||
from arrow import Arrow
|
||||
|
||||
from freqtrade import DependencyException, constants
|
||||
from freqtrade.arguments import Arguments, TimeRange
|
||||
from freqtrade.arguments import TimeRange
|
||||
from freqtrade.data import history
|
||||
from freqtrade.data.btanalysis import evaluate_result_multi
|
||||
from freqtrade.data.converter import parse_ticker_dataframe
|
||||
|
@ -23,11 +22,7 @@ from freqtrade.optimize.backtesting import Backtesting
|
|||
from freqtrade.state import RunMode
|
||||
from freqtrade.strategy.default_strategy import DefaultStrategy
|
||||
from freqtrade.strategy.interface import SellType
|
||||
from freqtrade.tests.conftest import log_has, log_has_re, patch_exchange
|
||||
|
||||
|
||||
def get_args(args) -> List[str]:
|
||||
return Arguments(args, '').get_parsed_arg()
|
||||
from freqtrade.tests.conftest import get_args, log_has, log_has_re, patch_exchange
|
||||
|
||||
|
||||
def trim_dictlist(dict_list, num):
|
||||
|
|
|
@ -2,19 +2,13 @@
|
|||
# pragma pylint: disable=protected-access, too-many-lines, invalid-name, too-many-arguments
|
||||
|
||||
import json
|
||||
from typing import List
|
||||
from unittest.mock import MagicMock
|
||||
|
||||
from freqtrade.arguments import Arguments
|
||||
from freqtrade.edge import PairInfo
|
||||
from freqtrade.optimize import start_edge, setup_configuration
|
||||
from freqtrade.optimize import setup_configuration, start_edge
|
||||
from freqtrade.optimize.edge_cli import EdgeCli
|
||||
from freqtrade.state import RunMode
|
||||
from freqtrade.tests.conftest import log_has, log_has_re, patch_exchange
|
||||
|
||||
|
||||
def get_args(args) -> List[str]:
|
||||
return Arguments(args, '').get_parsed_arg()
|
||||
from freqtrade.tests.conftest import get_args, log_has, log_has_re, patch_exchange
|
||||
|
||||
|
||||
def test_setup_configuration_without_arguments(mocker, default_conf, caplog) -> None:
|
||||
|
|
|
@ -16,8 +16,7 @@ from freqtrade.optimize.hyperopt import Hyperopt, HYPEROPT_LOCKFILE
|
|||
from freqtrade.optimize import setup_configuration, start_hyperopt
|
||||
from freqtrade.resolvers.hyperopt_resolver import HyperOptResolver
|
||||
from freqtrade.state import RunMode
|
||||
from freqtrade.tests.conftest import log_has, log_has_re, patch_exchange
|
||||
from freqtrade.tests.optimize.test_backtesting import get_args
|
||||
from freqtrade.tests.conftest import get_args, log_has, log_has_re, patch_exchange
|
||||
|
||||
|
||||
@pytest.fixture(scope='function')
|
||||
|
|
Loading…
Reference in New Issue
Block a user