@pytest.mark.skipif('not HAS_YAML')
def test_regression_5604():
 t = Table()
 t.meta = {'foo': (5 * u.km), 'foo2': u.s}
 t['bar'] = ([7] * u.km)
 out = StringIO()
 t.write(out, format='ascii.ecsv')
 assert ('!astropy.units.Unit' in out.getvalue())
 assert ('!astropy.units.Quantity' in out.getvalue())

@ pytest . mark . skipif ( 'not HAS_YAML' ) def test_regression_5604 ( ) : t = Table ( ) t . meta = { 'foo' : ( 5 * u . km ) , 'foo2' : u . s } t [ 'bar' ] = ( [ 7 ] * u . km ) out = StringIO ( ) t . write ( out , format = 'ascii.ecsv' ) assert ( '!astropy.units.Unit' in out . getvalue ( ) ) assert ( '!astropy.units.Quantity' in out . getvalue ( ) )
see URL for more .