MCPcopy Create free account
hub / github.com/fivetran/great_expectations / assert_logging_message_present

Function assert_logging_message_present

tests/cli/utils.py:58–73  ·  view source on GitHub ↗

Assert presence of message in logging output messages. :param my_caplog: the caplog pytest fixutre :param message: message to be searched in caplog

(my_caplog, message)

Source from the content-addressed store, hash-verified

56
57
58def assert_logging_message_present(my_caplog, message):
59 """
60 Assert presence of message in logging output messages.
61
62 :param my_caplog: the caplog pytest fixutre
63 :param message: message to be searched in caplog
64 """
65 assert isinstance(
66 my_caplog, LogCaptureFixture
67 ), "Please pass in the caplog object from your test."
68 messages = my_caplog.messages
69 assert isinstance(messages, list)
70 if messages:
71 print("Found logging messages:\n")
72 print("\n".join([m for m in messages]))
73 assert any([message in element for element in messages])
74
75
76def assert_no_logging_messages(my_caplog):

Calls

no outgoing calls

Tested by

no test coverage detected