Adds log levels for caplog since pytest isn't run in debug.

This commit is contained in:
philip 2022-01-04 17:52:38 +03:00
parent c5ee59f836
commit e4c41c2d3e
Signed by untrusted user: mango-habanero
GPG Key ID: B00CE9034DA19FB7
2 changed files with 4 additions and 0 deletions

View File

@ -1,4 +1,5 @@
# standard imports # standard imports
import logging
import os import os
# external imports # external imports
@ -15,6 +16,7 @@ from tests.helpers.phone import phone_number
def test_africas_talking_notifier(africastalking_response, caplog): def test_africas_talking_notifier(africastalking_response, caplog):
caplog.set_level(logging.DEBUG)
with pytest.raises(NotInitializedError) as error: with pytest.raises(NotInitializedError) as error:
AfricasTalkingNotifier() AfricasTalkingNotifier()
assert str(error.value) == '' assert str(error.value) == ''

View File

@ -1,4 +1,5 @@
# standard imports # standard imports
import logging
# external imports # external imports
import celery import celery
@ -12,6 +13,7 @@ from tests.helpers.phone import phone_number
def test_log(caplog, celery_session_worker): def test_log(caplog, celery_session_worker):
message = 'Hello world.' message = 'Hello world.'
recipient = phone_number() recipient = phone_number()
caplog.set_level(logging.INFO)
s_log = celery.signature( s_log = celery.signature(
'cic_notify.tasks.sms.log.log', [message, recipient] 'cic_notify.tasks.sms.log.log', [message, recipient]
) )