def expected_text(*args):
 text = '<table>'
 for group in args:
  text += "<tr><td>{}</td><td style='color: {}'>{}</td><td style='padding-left: 2ex'>{}</td></tr>".format(*group)
 return (text + '</table>')

def expected_text ( * args ) : text = '<table>' for group in args : text += "<tr><td>{}</td><td style='color: {}'>{}</td><td style='padding-left: 2ex'>{}</td></tr>" . format ( * group ) return ( text + '</table>' )
helper to format text we expect the keyhintview to generate .