def assert_regex(result, expected, msg=''):
 assert re.search(expected, result), ('%s%r not found in %r' % (_fmt_msg(msg), expected, result))

def assert_regex ( result , expected , msg = '' ) : assert re . search ( expected , result ) , ( '%s%r not found in %r' % ( _fmt_msg ( msg ) , expected , result ) )
assert that expected matches the result .