@bdd.then(bdd.parsers.re('(?P<is_regex>regex )?"(?P<pattern>[^"]+)" should be logged'))
def should_be_logged(quteproc, httpbin, is_regex, pattern):
 if is_regex:
  pattern = re.compile(pattern)
 else:
  pattern = pattern.replace('(port)', str(httpbin.port))
 line = quteproc.wait_for(message=pattern)
 line.expected = True

@ bdd . then ( bdd . parsers . re ( '(?P<is_regex>regex )?"(?P<pattern>[^"]+)" should be logged' ) ) def should_be_logged ( quteproc , httpbin , is_regex , pattern ) : if is_regex : pattern = re . compile ( pattern ) else : pattern = pattern . replace ( '(port)' , str ( httpbin . port ) ) line = quteproc . wait_for ( message = pattern ) line . expected = True
expect the given pattern on regex in the log .