From 9b998f698f98912928027d76d2f307e0d4b7b7a3 Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Fri, 23 Oct 2026 12:27:24 +0200 Subject: [PATCH] fix: skip schema checks without jsonschema --- tests/test_site_r3_entry.py | 2 +- tests/test_site_r3_reference.py | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/test_site_r3_entry.py b/tests/test_site_r3_entry.py index 0a81f5c5..cdc8a7e6 100644 --- a/tests/test_site_r3_entry.py +++ b/tests/test_site_r3_entry.py @@ -221,7 +221,7 @@ class GetYourFilesListsEachSetupOnce(unittest.TestCase): self.assertRegex(row, r" \(\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) diff --git a/tests/test_site_r3_reference.py b/tests/test_site_r3_reference.py index d631c7ba..3741f6fe 100644 --- a/tests/test_site_r3_reference.py +++ b/tests/test_site_r3_reference.py @@ -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"])