def test_reference_leak(self):

            from .test_core import TestCore

            t1 = TestCore()
            t1.setup()
            try:
                with _refcounting('FITS_rec'):
                    t1.test_add_del_columns2()
            finally:
                t1.teardown()
            del t1

            t2 = self.__class__()
            for test_name in ['test_recarray_to_bintablehdu',
                              'test_numpy_ndarray_to_bintablehdu',
                              'test_new_table_from_recarray',
                              'test_new_fitsrec']:
                t2.setup()
                try:
                    with _refcounting('FITS_rec'):
                        getattr(t2, test_name)()
                finally:
                    t2.teardown()
            del t2
Regression test for https://github.com/astropy/astropy/pull/4539
dataset/ETHPy150Open spacetelescope/PyFITS/pyfits/tests/test_table.py/TestTableFunctions.test_reference_leak