def assert_has_line_matching(output, expression):
 match = re.search(('^%s$' % expression), output, flags=re.MULTILINE)
 assert (match is not None), ("No line matching expression '%s' was found in output file." % expression)

def assert_has_line_matching ( output , expression ) : match = re . search ( ( '^%s$' % expression ) , output , flags = re . MULTILINE ) assert ( match is not None ) , ( "No line matching expression '%s' was found in output file." % expression )
asserts the specified output contains a line matching the regular expression specified by the argument expression .