def testOpenPathLikeFilename(self):
    filename = pathlib.Path(self.filename)
    with BZ2File(filename, 'wb') as f:
        f.write(self.DATA)
    with BZ2File(filename, 'rb') as f:
        self.assertEqual(f.read(), self.DATA)
def testOpenPathLikeFilename(self):
    filename = pathlib.Path(self.filename)
    with BZ2File(filename, 'wb') as f:
        f.write(self.DATA)
    with BZ2File(filename, 'rb') as f:
        self.assertEqual(f.read(), self.DATA)