fix: skip schema checks without jsonschema

This commit is contained in:
Abdessamad Derraz committed 2026-10-23 12:27:24 +02:00
1 parent 2a29ca309c
commit 9b998f698f
2 files changed
+9 -3

No files matched your search

+1 -1
View File
@@ -221,7 +221,7 @@ class GetYourFilesListsEachSetupOnce(unittest.TestCase):
self.assertRegex(row, r"</a> \(\d[\d.]* [KMG]B\) \|$")
def test_the_zip_note(self):
for line in ("A big ZIP comes in parts. Download every part.",
for line in ("A big ZIP comes in parts, like `Pack.part1of2.zip`. Download every part.",
"Leave the ZIPs inside, like `neogeo.zip`, as they are.",
"Their setup's page says where to unzip them."):
self.assertIn(line, self.text)
+8 -2
View File
@@ -200,7 +200,10 @@ class TheContractsValidate(unittest.TestCase):
"""8.4: registry keys leave the contract, every $id is its served URL."""
def test_every_contract_validates_against_the_platform_schema(self):
from jsonschema import Draft202012Validator # noqa: PLC0415
try:
from jsonschema import Draft202012Validator # noqa: PLC0415
except ImportError:
self.skipTest("jsonschema is a tooling dependency")
from common import list_registered_platforms, load_platform_config # noqa: PLC0415
@@ -228,7 +231,10 @@ class TheContractsValidate(unittest.TestCase):
self.assertEqual(published, {p.name for p in (REPO_ROOT / "schemas").glob("*.schema.json")})
def test_the_built_api_validates(self):
from jsonschema import Draft202012Validator # noqa: PLC0415
try:
from jsonschema import Draft202012Validator # noqa: PLC0415
except ImportError:
self.skipTest("jsonschema is a tooling dependency")
schemas = {p.name: json.loads(p.read_text()) for p in (REPO_ROOT / "schemas").glob("*.json")}
envelope = Draft202012Validator(schemas["site-api-envelope.schema.json"])