Skip to content

Commit

Permalink
jsonschemaDeprecationWarning-fix (#857)
Browse files Browse the repository at this point in the history
* Passing a schema to Validator.is_valid is deprecated and will be removed in a future release. Call validator.evolve(schema=new_schema).is_valid(...) instead.
  • Loading branch information
AlexNg9527 committed Dec 26, 2023
1 parent 1f43f53 commit 36f3ead
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tavern/_core/schema/jsonschema.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ def oneOf(validator: Draft7Validator, oneOf, instance, schema):
context=all_errors,
)

more_valid = [s for i, s in subschemas if validator.is_valid(instance, s)]
more_valid = [
s for i, s in subschemas if validator.evolve(schema=s).is_valid(instance)
]
if more_valid:
more_valid.append(first_valid)
reprs = ", ".join(repr(schema) for schema in more_valid)
Expand Down

0 comments on commit 36f3ead

Please sign in to comment.