'Test for https://github.com/astropy/astropy/pull/4080'

def test_as_array_byteswap(self, table_types):

    byte_orders = ('>', '<')
    native_order = byte_orders[(sys.byteorder == 'little')]
    for order in byte_orders:
        col = table_types.Column([1.0, 2.0], name='a', dtype=(order + 'f8'))
        t = table_types.Table([col])
        arr = t.as_array()
        assert (arr['a'].dtype.byteorder in (native_order, '='))
        arr = t.as_array(keep_byteorder=True)
        if (order == native_order):
            assert (arr['a'].dtype.byteorder in (order, '='))
        else:
            assert (arr['a'].dtype.byteorder == order)
