@bdd.then(bdd.parsers.re('the (?P<category>error|message|warning) "(?P<message>.*)" should be shown'))
def expect_message(quteproc, httpbin, category, message):
 category_to_loglevel = {'message': logging.INFO, 'error': logging.ERROR, 'warning': logging.WARNING}
 message = message.replace('(port)', str(httpbin.port))
 quteproc.mark_expected(category='message', loglevel=category_to_loglevel[category], message=message)

@ bdd . then ( bdd . parsers . re ( 'the (?P<category>error|message|warning) "(?P<message>.*)" should be shown' ) ) def expect_message ( quteproc , httpbin , category , message ) : category_to_loglevel = { 'message' : logging . INFO , 'error' : logging . ERROR , 'warning' : logging . WARNING } message = message . replace ( '(port)' , str ( httpbin . port ) ) quteproc . mark_expected ( category = 'message' , loglevel = category_to_loglevel [ category ] , message = message )
expect the given message in the qutebrowser log .