'Check that the zipfile is closed if an exception is raised in the
\'with\' block.'

def test_close_on_exception(self):

    with zipfile.ZipFile(TESTFN2, 'w') as zipfp:
        for (fpath, fdata) in SMALL_TEST_DATA:
            zipfp.writestr(fpath, fdata)
    try:
        with zipfile.ZipFile(TESTFN2, 'r') as zipfp2:
            raise zipfile.BadZipFile()
    except zipfile.BadZipFile:
        self.assertIsNone(zipfp2.fp, 'zipfp    is    not    closed')
