#NEWLINE# def test_write_read_gzip_file( self ) : #NEWLINE# #INDENT# '\n        Regression test for https://github.com/astropy/astropy/issues/2794\n\n        Ensure files written through gzip are readable.\n        ' #NEWLINE# data = np . arange ( 100 ) #NEWLINE# hdu = fits . PrimaryHDU ( data = data ) #NEWLINE# hdu . writeto ( self . temp ( 'test.fits.gz' ) ) #NEWLINE# with open ( self . temp ( 'test.fits.gz' ) , 'rb' ) as f : #NEWLINE# #INDENT# assert ( f . read ( 3 ) == GZIP_MAGIC ) #NEWLINE# #UNINDENT# with fits . open ( self . temp ( 'test.fits.gz' ) ) as hdul : #NEWLINE# #INDENT# assert np . all ( ( hdul [ 0 ] . data == data ) )