#NEWLINE# @ contextmanager #NEWLINE# def assert_logs( self , levels = None , log_regex = '.*' ) : #NEWLINE# #INDENT# 'Asserts that the given block will log some messages.\n\n        Args:\n          levels -- log level to look for. By default, look at all levels\n          log_regex -- regex matching a particular log message to look for. By default,\n            any message will match.\n        ' #NEWLINE# self . clear ( ) #NEWLINE# ( yield ) #NEWLINE# self . assert_logged ( levels , log_regex )