def assert_tokens_equal(x, y):
 if (len(x) != len(y)):
  msg = u'The tokens sequences have different lengths: {0!r} != {1!r}\n'
  msg += u'# x\n{2}\n\n# y\n{3}'
  pytest.fail(msg.format(len(x), len(y), pformat(x), pformat(y)))
 diffs = [(a, b) for (a, b) in zip(x, y) if (not tokens_equal(a, b))]
 if (len(diffs) > 0):
  msg = [u'The token sequences differ: ']
  for (a, b) in diffs:
   msg += [u'', (u'- ' + repr(a)), (u'+ ' + repr(b))]
  msg = u'\n'.join(msg)
  pytest.fail(msg)
 return True

def assert_tokens_equal ( x , y ) : if ( len ( x ) != len ( y ) ) : msg = u'The tokens sequences have different lengths: {0!r} != {1!r}\n' msg += u'# x\n{2}\n\n# y\n{3}' pytest . fail ( msg . format ( len ( x ) , len ( y ) , pformat ( x ) , pformat ( y ) ) ) diffs = [ ( a , b ) for ( a , b ) in zip ( x , y ) if ( not tokens_equal ( a , b ) ) ] if ( len ( diffs ) > 0 ) : msg = [ u'The token sequences differ: ' ] for ( a , b ) in diffs : msg += [ u'' , ( u'- ' + repr ( a ) ) , ( u'+ ' + repr ( b ) ) ] msg = u'\n' . join ( msg ) pytest . fail ( msg ) return True
asserts that two token sequences are equal .