Skip to content

Commit

Permalink
test: fix python tests
Browse files Browse the repository at this point in the history
Signed-off-by: Dmitry Dygalo <[email protected]>
  • Loading branch information
Stranger6667 committed Mar 2, 2024
1 parent c7ca411 commit 558d13d
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions bindings/python/tests-py/test_suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand All @@ -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)

0 comments on commit 558d13d

Please sign in to comment.