@pytest.mark.skipif('not HAS_YAML')
def test_write_read_roundtrip():
 t = T_DTYPES
 for delimiter in DELIMITERS:
  out = StringIO()
  t.write(out, format='ascii.ecsv', delimiter=delimiter)
  t2s = [Table.read(out.getvalue(), format='ascii.ecsv'), Table.read(out.getvalue(), format='ascii'), ascii.read(out.getvalue()), ascii.read(out.getvalue(), format='ecsv', guess=False), ascii.read(out.getvalue(), format='ecsv')]
  for t2 in t2s:
   assert (t.meta == t2.meta)
   for name in t.colnames:
    assert t[name].attrs_equal(t2[name])
    assert np.all((t[name] == t2[name]))

@ pytest . mark . skipif ( 'not HAS_YAML' ) def test_write_read_roundtrip ( ) : t = T_DTYPES for delimiter in DELIMITERS : out = StringIO ( ) t . write ( out , format = 'ascii.ecsv' , delimiter = delimiter ) t2s = [ Table . read ( out . getvalue ( ) , format = 'ascii.ecsv' ) , Table . read ( out . getvalue ( ) , format = 'ascii' ) , ascii . read ( out . getvalue ( ) ) , ascii . read ( out . getvalue ( ) , format = 'ecsv' , guess = False ) , ascii . read ( out . getvalue ( ) , format = 'ecsv' ) ] for t2 in t2s : assert ( t . meta == t2 . meta ) for name in t . colnames : assert t [ name ] . attrs_equal ( t2 [ name ] ) assert np . all ( ( t [ name ] == t2 [ name ] ) )
write a full-featured table with all types and see that it round-trips on readback .