tests: don't mask numpy errors as warnings in tests

This commit is contained in:
hroff-1902 2019-07-26 16:30:14 +03:00 committed by Matthias
parent 8ba7657007
commit 5209ce5bfa

View File

@ -10,6 +10,7 @@ from unittest.mock import MagicMock, PropertyMock
import arrow
import pytest
import numpy as np
from telegram import Chat, Message, Update
from freqtrade import constants, persistence
@ -25,6 +26,10 @@ from freqtrade.worker import Worker
logging.getLogger('').setLevel(logging.INFO)
# Do not mask numpy errors as warnings that no one read, raise the exсeption
np.seterr(all='raise')
def log_has(line, logs):
# caplog mocker returns log as a tuple: ('freqtrade.something', logging.WARNING, 'foobar')
# and we want to match line against foobar in the tuple