def test_reference_leak(self):

            # There are still other leads created by reference cycles in
            # FITS_rec that are not fixed by the fix to #520.  In particular, a
            # known leak is created by: self._coldefs [ColDefs] ->
            # ColDefs.columns[n].array [ndarray] -> ndarray.base [FITS_rec] ->
            # self
            #
            # In other words, the columns list in the coldefs attribute of the
            # FITS_rec, contains Column objects whose .array attributes are
            # updated to point to fields in the original FITS_rec, creating a
            # cycle.  This is an outstanding issue with the original design of
            # pyfits, and may or may not be fixed, depending on how soon
            # FITS_rec is deprecated.
            #
            # In the meantime, this test ensures that no *new* FITS_rec objects
            # are left behind in this one use case, which *is* fixed by #520.
            # There are other cases that still create leaks though.
            existing_fitsrecs = len(objgraph.by_type('FITS_rec'))

            def readfile(filename):
                with fits.open(filename) as hdul:
                    data = hdul[1].data.copy()

                for colname in data.dtype.names:
                    data[colname]

            readfile(self.data('memtest.fits'))

            # Shouldn't matter since ndarray and subclasses don't participate
            # in garbage collection, but just in case...
            gc.collect()

            # Just make sure there aren't more FITS_rec objects remaining in
            # memory than we started with.
            assert len(objgraph.by_type('FITS_rec')) <= existing_fitsrecs
Ability to limit iterations to a specified user and a date in the
dataset/ETHPy150Open spacetelescope/PyFITS/pyfits/tests/test_table.py/TestTableFunctions.test_reference_leak--crossover with--dataset/ETHPy150Open Matt-Deacalion/Mentalist/mentalist/apps/core/tests.py/EditionContextTests.test_future_date