aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2024-01-06 08:15:54 +0100
committerMichał Górny <mgorny@gentoo.org>2024-02-07 08:42:54 +0100
commita69c9b4cec33bbf2fbb90303be63c8128061e285 (patch)
tree7f5d50faadc67350fef17b8221e18a5bf19be2fb
parentPrevent tests from detecting our fake tzdata package (diff)
downloadcpython-gentoo-3.11.8.tar.gz
cpython-gentoo-3.11.8.tar.bz2
cpython-gentoo-3.11.8.zip
test_lzma: Skip tests requiring extra-filtersgentoo-3.11.8
Signed-off-by: Michał Górny <mgorny@gentoo.org>
-rw-r--r--Lib/test/test_lzma.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/Lib/test/test_lzma.py b/Lib/test/test_lzma.py
index d2ae133a41f..e4050658c61 100644
--- a/Lib/test/test_lzma.py
+++ b/Lib/test/test_lzma.py
@@ -118,14 +118,17 @@ class CompressorDecompressorTestCase(unittest.TestCase):
lzd = LZMADecompressor(lzma.FORMAT_RAW, filters=FILTERS_RAW_1)
self._test_decompressor(lzd, COMPRESSED_RAW_1, lzma.CHECK_NONE)
+ @unittest.skip("Gentoo: requires app-arch?xz-utils[extra-filters]")
def test_decompressor_raw_2(self):
lzd = LZMADecompressor(lzma.FORMAT_RAW, filters=FILTERS_RAW_2)
self._test_decompressor(lzd, COMPRESSED_RAW_2, lzma.CHECK_NONE)
+ @unittest.skip("Gentoo: requires app-arch?xz-utils[extra-filters]")
def test_decompressor_raw_3(self):
lzd = LZMADecompressor(lzma.FORMAT_RAW, filters=FILTERS_RAW_3)
self._test_decompressor(lzd, COMPRESSED_RAW_3, lzma.CHECK_NONE)
+ @unittest.skip("Gentoo: requires app-arch?xz-utils[extra-filters]")
def test_decompressor_raw_4(self):
lzd = LZMADecompressor(lzma.FORMAT_RAW, filters=FILTERS_RAW_4)
self._test_decompressor(lzd, COMPRESSED_RAW_4, lzma.CHECK_NONE)
@@ -288,12 +291,14 @@ class CompressorDecompressorTestCase(unittest.TestCase):
lzd = LZMADecompressor()
self._test_decompressor(lzd, cdata, lzma.CHECK_NONE)
+ @unittest.skip("Gentoo: requires app-arch?xz-utils[extra-filters]")
def test_roundtrip_raw(self):
lzc = LZMACompressor(lzma.FORMAT_RAW, filters=FILTERS_RAW_4)
cdata = lzc.compress(INPUT) + lzc.flush()
lzd = LZMADecompressor(lzma.FORMAT_RAW, filters=FILTERS_RAW_4)
self._test_decompressor(lzd, cdata, lzma.CHECK_NONE)
+ @unittest.skip("Gentoo: requires app-arch?xz-utils[extra-filters]")
def test_roundtrip_raw_empty(self):
lzc = LZMACompressor(lzma.FORMAT_RAW, filters=FILTERS_RAW_4)
cdata = lzc.compress(INPUT)
@@ -443,6 +448,8 @@ class CompressDecompressFunctionTestCase(unittest.TestCase):
COMPRESSED_RAW_1, lzma.FORMAT_RAW, filters=FILTERS_RAW_1)
self.assertEqual(ddata, INPUT)
+ # Gentoo: these require app-arch?xz-utils[extra-filters]
+ return
ddata = lzma.decompress(
COMPRESSED_RAW_2, lzma.FORMAT_RAW, filters=FILTERS_RAW_2)
self.assertEqual(ddata, INPUT)
@@ -460,6 +467,8 @@ class CompressDecompressFunctionTestCase(unittest.TestCase):
self.assertRaises(LZMAError, lzma.decompress, COMPRESSED_ALONE[:128])
self.assertRaises(LZMAError, lzma.decompress, COMPRESSED_RAW_1[:128],
format=lzma.FORMAT_RAW, filters=FILTERS_RAW_1)
+ # Gentoo: these require app-arch?xz-utils[extra-filters]
+ return
self.assertRaises(LZMAError, lzma.decompress, COMPRESSED_RAW_2[:128],
format=lzma.FORMAT_RAW, filters=FILTERS_RAW_2)
self.assertRaises(LZMAError, lzma.decompress, COMPRESSED_RAW_3[:128],
@@ -495,6 +504,8 @@ class CompressDecompressFunctionTestCase(unittest.TestCase):
ddata = lzma.decompress(cdata)
self.assertEqual(ddata, INPUT)
+ # Gentoo: these require app-arch?xz-utils[extra-filters]
+ return
cdata = lzma.compress(INPUT, lzma.FORMAT_RAW, filters=FILTERS_RAW_4)
ddata = lzma.decompress(cdata, lzma.FORMAT_RAW, filters=FILTERS_RAW_4)
self.assertEqual(ddata, INPUT)
@@ -799,6 +810,8 @@ class FileTestCase(unittest.TestCase):
format=lzma.FORMAT_RAW, filters=FILTERS_RAW_1) as f:
self.assertEqual(f.read(), INPUT)
self.assertEqual(f.read(), b"")
+ # Gentoo: these require app-arch?xz-utils[extra-filters]
+ return
with LZMAFile(BytesIO(COMPRESSED_RAW_2),
format=lzma.FORMAT_RAW, filters=FILTERS_RAW_2) as f:
self.assertEqual(f.read(), INPUT)
@@ -838,6 +851,8 @@ class FileTestCase(unittest.TestCase):
self.assertEqual(f.read(), INPUT * 5)
with LZMAFile(BytesIO(COMPRESSED_XZ + COMPRESSED_ALONE)) as f:
self.assertEqual(f.read(), INPUT * 2)
+ # Gentoo: these require app-arch?xz-utils[extra-filters]
+ return
with LZMAFile(BytesIO(COMPRESSED_RAW_3 * 4),
format=lzma.FORMAT_RAW, filters=FILTERS_RAW_3) as f:
self.assertEqual(f.read(), INPUT * 4)
@@ -981,6 +996,8 @@ class FileTestCase(unittest.TestCase):
self.assertListEqual(list(iter(f)), lines)
with LZMAFile(BytesIO(COMPRESSED_ALONE), format=lzma.FORMAT_ALONE) as f:
self.assertListEqual(list(iter(f)), lines)
+ # Gentoo: these require app-arch?xz-utils[extra-filters]
+ return
with LZMAFile(BytesIO(COMPRESSED_RAW_2),
format=lzma.FORMAT_RAW, filters=FILTERS_RAW_2) as f:
self.assertListEqual(list(iter(f)), lines)
@@ -1025,6 +1042,8 @@ class FileTestCase(unittest.TestCase):
f.write(INPUT)
expected = lzma.compress(INPUT, format=lzma.FORMAT_ALONE)
self.assertEqual(dst.getvalue(), expected)
+ # Gentoo: these require app-arch?xz-utils[extra-filters]
+ return
with BytesIO() as dst:
with LZMAFile(dst, "w", format=lzma.FORMAT_RAW,
filters=FILTERS_RAW_2) as f:
@@ -1409,6 +1428,8 @@ class MiscellaneousTestCase(unittest.TestCase):
self.assertEqual(filterspec["lc"], 3)
self.assertEqual(filterspec["dict_size"], 8 << 20)
+ # Gentoo: these require app-arch?xz-utils[extra-filters]
+ return
# see gh-104282
filters = [lzma.FILTER_X86, lzma.FILTER_POWERPC,
lzma.FILTER_IA64, lzma.FILTER_ARM,