'Regression test for https://github.com/astropy/astropy/pull/520'

@pytest.mark.skipif(str('not    HAVE_OBJGRAPH'))
def test_reference_leak(self):

    def readfile(filename):
        with fits.open(filename) as hdul:
            data = hdul[1].data.copy()
        for colname in data.dtype.names:
            data[colname]
    with _refcounting('FITS_rec'):
        readfile(self.data('memtest.fits'))
