fix: skip schema tests when jsonschema is absent

This commit is contained in:
Abdessamad Derraz committed 2026-10-06 05:08:40 +02:00
1 parent 1e4ffa3db1
commit b307de5719
4 files changed
+82

No files matched your search

+8
View File
@@ -20,6 +20,13 @@ from pathlib import Path
import yaml
try:
import jsonschema # noqa: F401
except ImportError:
HAS_JSONSCHEMA = False
else:
HAS_JSONSCHEMA = True
REPO_ROOT = Path(__file__).resolve().parent.parent
sys.path.insert(0, str(REPO_ROOT / "scripts"))
@@ -142,6 +149,7 @@ class ManifestStatesWhatThePackHolds(PackCountFixture):
self.assertEqual(manifest["total_files"], 2)
self.assertEqual(manifest["pack_files"], 2 + 3 + len(builder.PACK_DOCUMENTS))
@unittest.skipUnless(HAS_JSONSCHEMA, "validating a schema needs jsonschema")
def test_the_manifest_schema_accepts_the_two_figures(self):
from jsonschema import Draft202012Validator