def testFileno(self):
    self.createTempFile()
    with open(self.filename, 'rb') as rawf:
        bz2f = BZ2File(rawf)
        try:
            self.assertEqual(bz2f.fileno(), rawf.fileno())
        finally:
            bz2f.close()
    self.assertRaises(ValueError, bz2f.fileno)
def testFileno(self):
    self.createTempFile()
    with open(self.filename, 'rb') as rawf:
        bz2f = BZ2File(rawf)
        try:
            self.assertEqual(bz2f.fileno(), rawf.fileno())
        finally:
            bz2f.close()
    self.assertRaises(ValueError, bz2f.fileno)