def testReadBytesIO(self):
    with BytesIO(self.DATA) as bio:
        with BZ2File(bio) as bz2f:
            self.assertRaises(TypeError, bz2f.read, float())
            self.assertEqual(bz2f.read(), self.TEXT)
        self.assertFalse(bio.closed)
def testReadBytesIO(self):
    with BytesIO(self.DATA) as bio:
        with BZ2File(bio) as bz2f:
            self.assertRaises(TypeError, bz2f.read, float())
            self.assertEqual(bz2f.read(), self.TEXT)
        self.assertFalse(bio.closed)