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

View File

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