'Regression test for https://aeon.stsci.edu/ssb/trac/pyfits/ticket/86
Numpy recarray objects have a poorly-considered feature of allowing
field access by attribute lookup.  However, if a field name conincides
with an existing attribute/method of the array, the existing name takes
precence (making the attribute-based field lookup completely unreliable
in general cases).
This ensures that any FITS_rec attributes still work correctly even
when there is a field with the same name as that attribute.'

def test_attribute_field_shadowing(self):

    c1 = fits.Column(name='names', format='I', array=[1])
    c2 = fits.Column(name='formats', format='I', array=[2])
    c3 = fits.Column(name='other', format='I', array=[3])
    t = fits.BinTableHDU.from_columns([c1, c2, c3])
    assert (t.data.names == ['names', 'formats', 'other'])
    assert (t.data.formats == (['I'] * 3))
    assert (t.data['names'] == [1]).all()
    assert (t.data['formats'] == [2]).all()
    assert (t.data.other == [3]).all()
