Skip to content

Commit 2074025

Browse files
committed
add test skip for ztandard when the module is missing
Signed-off-by: Zen <[email protected]>
1 parent 141fe1a commit 2074025

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tests/test_compression.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from uuid import uuid4
44

55
from pycpio import PyCPIO
6+
from pycpio.errors import UnavailableCompression
67
from zenlib.logging import loggify
78

89

@@ -71,7 +72,10 @@ def test_write_zstd_compress(self):
7172
self.make_test_files(100)
7273
self.cpio.append_recursive(self.workdir.name)
7374
out_file = NamedTemporaryFile()
74-
self.cpio.write_cpio_file(out_file.file.name, compression="zstd")
75+
try:
76+
self.cpio.write_cpio_file(out_file.file.name, compression="zstd")
77+
except UnavailableCompression as e:
78+
self.skipTest(f"Zstandard compression is not available in this environment: {e}")
7579
out_file.file.flush()
7680

7781

0 commit comments

Comments
 (0)