From 558d13db3587b851ecc3645ff679037e30d7ad7a Mon Sep 17 00:00:00 2001 From: Dmitry Dygalo Date: Sat, 2 Mar 2024 23:53:20 +0100 Subject: [PATCH] test: fix python tests Signed-off-by: Dmitry Dygalo --- bindings/python/tests-py/test_suite.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/bindings/python/tests-py/test_suite.py b/bindings/python/tests-py/test_suite.py index 1c0237a..3fe4d5b 100644 --- a/bindings/python/tests-py/test_suite.py +++ b/bindings/python/tests-py/test_suite.py @@ -72,9 +72,16 @@ def maybe_optional(draft, schema, instance, expected, description, filename): def pytest_generate_tests(metafunc): cases = [ - maybe_optional(draft, block["schema"], test["data"], test["valid"], test["description"], filename) + maybe_optional( + draft, + block["schema"], + test["data"], + test["valid"], + test["description"], + filename, + ) for draft in SUPPORTED_DRAFTS - for root, dirs, files in os.walk(f"{TEST_SUITE_PATH}/tests/draft{draft}/") + for root, _, files in os.walk(f"{TEST_SUITE_PATH}/tests/draft{draft}/") for filename in files for block in load_file(os.path.join(root, filename)) for test in block["tests"] @@ -85,7 +92,7 @@ def pytest_generate_tests(metafunc): def test_draft(filename, draft, schema, instance, expected, description): error_message = f"[{filename}] {description}: {schema} | {instance}" try: - result = jsonschema_rs.is_valid(schema, instance, int(draft)) + result = jsonschema_rs.is_valid(schema, instance, int(draft), with_meta_schemas=True) assert result is expected, error_message except ValueError: pytest.fail(error_message)