set capturing level

This commit is contained in:
Janne Sinivirta
2018-01-31 19:37:38 +02:00
parent 8ba08af539
commit 45975c9677
7 changed files with 24 additions and 1 deletions

View File

@@ -168,6 +168,7 @@ def mocked_load_data(datadir, pairs=[], ticker_interval=0, refresh_pairs=False,
def test_backtest_start(default_conf, mocker, caplog):
caplog.set_level(logging.INFO)
default_conf['exchange']['pair_whitelist'] = ['BTC_UNITEST']
mocker.patch.dict('freqtrade.main._CONF', default_conf)
mocker.patch('freqtrade.misc.load_config', new=lambda s: default_conf)

View File

@@ -1,4 +1,6 @@
# pragma pylint: disable=missing-docstring,W0212,C0103
import logging
from freqtrade.optimize.hyperopt import calculate_loss, TARGET_TRADES, EXPECTED_MAX_PROFIT, start, \
log_results, save_trials, read_trials, generate_roi_table
@@ -109,6 +111,7 @@ def test_no_log_if_loss_does_not_improve(mocker):
def test_fmin_best_results(mocker, caplog):
caplog.set_level(logging.INFO)
fmin_result = {
"macd_below_zero": 0,
"adx": 1,
@@ -156,6 +159,7 @@ def test_fmin_best_results(mocker, caplog):
def test_fmin_throw_value_error(mocker, caplog):
caplog.set_level(logging.INFO)
mocker.patch('freqtrade.optimize.hyperopt.MongoTrials', return_value=create_trials(mocker))
mocker.patch('freqtrade.optimize.tickerdata_to_dataframe')
mocker.patch('freqtrade.optimize.load_data')

View File

@@ -46,6 +46,7 @@ def _clean_test_file(file: str) -> None:
def test_load_data_30min_ticker(default_conf, ticker_history, mocker, caplog):
caplog.set_level(logging.INFO)
mocker.patch('freqtrade.optimize.get_ticker_history', return_value=ticker_history)
mocker.patch.dict('freqtrade.main._CONF', default_conf)
@@ -62,6 +63,7 @@ def test_load_data_30min_ticker(default_conf, ticker_history, mocker, caplog):
def test_load_data_5min_ticker(default_conf, ticker_history, mocker, caplog):
caplog.set_level(logging.INFO)
mocker.patch('freqtrade.optimize.get_ticker_history', return_value=ticker_history)
mocker.patch.dict('freqtrade.main._CONF', default_conf)
@@ -78,6 +80,7 @@ def test_load_data_5min_ticker(default_conf, ticker_history, mocker, caplog):
def test_load_data_1min_ticker(default_conf, ticker_history, mocker, caplog):
caplog.set_level(logging.INFO)
mocker.patch('freqtrade.optimize.get_ticker_history', return_value=ticker_history)
mocker.patch.dict('freqtrade.main._CONF', default_conf)
@@ -94,6 +97,7 @@ def test_load_data_1min_ticker(default_conf, ticker_history, mocker, caplog):
def test_load_data_with_new_pair_1min(default_conf, ticker_history, mocker, caplog):
caplog.set_level(logging.INFO)
mocker.patch('freqtrade.optimize.get_ticker_history', return_value=ticker_history)
mocker.patch.dict('freqtrade.main._CONF', default_conf)
@@ -154,6 +158,7 @@ def test_download_pairs(default_conf, ticker_history, mocker):
def test_download_pairs_exception(default_conf, ticker_history, mocker, caplog):
caplog.set_level(logging.INFO)
mocker.patch('freqtrade.optimize.__init__.get_ticker_history', return_value=ticker_history)
mocker.patch('freqtrade.optimize.__init__.download_backtesting_testdata',
side_effect=BaseException('File Error'))