Skip to content

Commit c086aa7

Browse files
committed
skip zstd tests if the compression module is missing
Signed-off-by: Zen <[email protected]>
1 parent 73ccaac commit c086aa7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tests/test_ugrd.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from unittest import TestCase, main
22

33
from ugrd.initramfs_generator import InitramfsGenerator
4+
from pycpio.errors import UnavailableCompression
45
from zenlib.logging import loggify
56

67

@@ -19,7 +20,10 @@ def test_xz(self):
1920
def test_zstd(self):
2021
"""Test ZSTD compression for initramfs."""
2122
generator = InitramfsGenerator(logger=self.logger, config="tests/fullauto.toml", cpio_compression="zstd")
22-
generator.build()
23+
try:
24+
generator.build()
25+
except UnavailableCompression as e:
26+
self.skipTest(f"ZSTD compression is not available: {e}")
2327

2428
def test_bad_config(self):
2529
"""Test that a bad config file which should raise an error."""

0 commit comments

Comments
 (0)