'Tests that file-like objects are not closed after being passed
to convenience functions.
Regression test for https://github.com/astropy/astropy/issues/5063'

def test_fileobj_not_closed(self):

    f = open(self.data('test0.fits'), 'rb')
    data = fits.getdata(f)
    assert (not f.closed)
    f.seek(0)
    header = fits.getheader(f)
    assert (not f.closed)
