Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix test_bz2
  • Loading branch information
arihant2math committed Apr 15, 2025
commit 3b77b422a754a7edffb254917c72fdab8100ffa7
16 changes: 0 additions & 16 deletions Lib/test/test_bz2.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,17 +272,13 @@ def testClosedIteratorDeadlock(self):
# This call will deadlock if the above call failed to release the lock.
self.assertRaises(ValueError, bz2f.readlines)

# TODO: RUSTPYTHON
@unittest.expectedFailure
def testWrite(self):
with BZ2File(self.filename, "w") as bz2f:
self.assertRaises(TypeError, bz2f.write)
bz2f.write(self.TEXT)
with open(self.filename, 'rb') as f:
self.assertEqual(ext_decompress(f.read()), self.TEXT)

# TODO: RUSTPYTHON
@unittest.expectedFailure
def testWriteChunks10(self):
with BZ2File(self.filename, "w") as bz2f:
n = 0
Expand All @@ -302,8 +298,6 @@ def testWriteNonDefaultCompressLevel(self):
with open(self.filename, "rb") as f:
self.assertEqual(f.read(), expected)

# TODO: RUSTPYTHON
@unittest.expectedFailure
def testWriteLines(self):
with BZ2File(self.filename, "w") as bz2f:
self.assertRaises(TypeError, bz2f.writelines)
Expand All @@ -322,8 +316,6 @@ def testWriteMethodsOnReadOnlyFile(self):
self.assertRaises(OSError, bz2f.write, b"a")
self.assertRaises(OSError, bz2f.writelines, [b"a"])

# TODO: RUSTPYTHON
@unittest.expectedFailure
def testAppend(self):
with BZ2File(self.filename, "w") as bz2f:
self.assertRaises(TypeError, bz2f.write)
Expand Down Expand Up @@ -667,8 +659,6 @@ def testPeekBytesIO(self):
self.assertTrue(self.TEXT.startswith(pdata))
self.assertEqual(bz2f.read(), self.TEXT)

# TODO: RUSTPYTHON
@unittest.expectedFailure
def testWriteBytesIO(self):
with BytesIO() as bio:
with BZ2File(bio, "w") as bz2f:
Expand Down Expand Up @@ -720,8 +710,6 @@ def test_issue44439(self):


class BZ2CompressorTest(BaseTest):
# TODO: RUSTPYTHON
@unittest.expectedFailure
def testCompress(self):
bz2c = BZ2Compressor()
self.assertRaises(TypeError, bz2c.compress)
Expand All @@ -735,8 +723,6 @@ def testCompressEmptyString(self):
data += bz2c.flush()
self.assertEqual(data, self.EMPTY_DATA)

# TODO: RUSTPYTHON
@unittest.expectedFailure
def testCompressChunks10(self):
bz2c = BZ2Compressor()
n = 0
Expand Down Expand Up @@ -964,8 +950,6 @@ def test_uninitialized_BZ2Decompressor_crash(self):


class CompressDecompressTest(BaseTest):
# TODO: RUSTPYTHON
@unittest.expectedFailure
def testCompress(self):
data = bz2.compress(self.TEXT)
self.assertEqual(ext_decompress(data), self.TEXT)
Expand Down
Loading