def test_pprint_py3_bytes():
 val = (str('val') if PY2 else bytes('val', encoding='utf-8'))
 blah = (u'bl\xe4h'.encode('utf-8') if PY2 else bytes('bl\xc3\xa4h', encoding='utf-8'))
 dat = np.array([val, blah], dtype=[(str('col'), 'S10')])
 t = table.Table(dat)
 assert (t['col'].pformat() == ['col ', '----', ' val', u'bl\xe4h'])

def test_pprint_py3_bytes ( ) : val = ( str ( 'val' ) if PY2 else bytes ( 'val' , encoding = 'utf-8' ) ) blah = ( u'bl\xe4h' . encode ( 'utf-8' ) if PY2 else bytes ( 'bl\xc3\xa4h' , encoding = 'utf-8' ) ) dat = np . array ( [ val , blah ] , dtype = [ ( str ( 'col' ) , 'S10' ) ] ) t = table . Table ( dat ) assert ( t [ 'col' ] . pformat ( ) == [ 'col ' , '----' , ' val' , u'bl\xe4h' ] )
test for #1346 and #4944 .