'Test writing to a bzip2 file by name'

def test_writeto_bzip2_filename(self):

    filename = self.temp('testname.fits.bz2')
    h = fits.PrimaryHDU()
    h.writeto(filename)
    with fits.open(self.temp('testname.fits.bz2')) as hdul:
        assert (hdul[0].header == h.header)
