Merge pull request #356 from kryofly/test_coverage

Test coverage
This commit is contained in:
Janne Sinivirta
2018-01-25 09:31:06 +02:00
committed by GitHub
9 changed files with 345 additions and 80 deletions

View File

@@ -1,6 +1,7 @@
# pragma pylint: disable=missing-docstring
from datetime import datetime
from unittest.mock import MagicMock
from functools import reduce
import arrow
import pytest
@@ -10,6 +11,14 @@ from telegram import Chat, Message, Update
from freqtrade.misc import CONF_SCHEMA
def log_has(line, logs):
# caplog mocker returns log as a tuple: ('freqtrade.analyze', logging.WARNING, 'foobar')
# and we want to match line against foobar in the tuple
return reduce(lambda a, b: a or b,
filter(lambda x: x[2] == line, logs),
False)
@pytest.fixture(scope="module")
def default_conf():
""" Returns validated configuration suitable for most tests """