'Regression test for https://aeon.stsci.edu/ssb/trac/pyfits/ticket/195.'

def test_open_gzip_file_for_writing(self):

    gf = self._make_gzip_file()
    with fits.open(gf, mode='update') as h:
        h[0].header['EXPFLAG'] = 'ABNORMAL'
    with fits.open(gf) as h:
        assert (h[0].header['EXPFLAG'] == 'ABNORMAL')
