Skip to content

Commit

Permalink
Merge branch 'master' into test-assert
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelboulton authored Nov 19, 2023
2 parents 8c09a6f + 5c36caa commit a56c01e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ dependencies = [
"jmespath>=1,<2",
"jsonschema>=3.2.0,<5",
"paho-mqtt>=1.3.1,<=1.6.1",
"pyjwt>=2.6.0,<3",
"pyjwt>=2.5.0,<3",
"pykwalify>=1.8.0,<2",
"pytest>=7,<7.3",
"python-box>=6,<7",
Expand Down
6 changes: 2 additions & 4 deletions tavern/_core/schema/jsonschema.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def is_object_or_sentinel(checker, instance):
)


def oneOf(validator: jsonschema.protocols.Validator, oneOf, instance, schema):
def oneOf(validator, oneOf, instance, schema):
"""Patched version of 'oneof' that does not complain if something is matched by multiple branches"""
subschemas = enumerate(oneOf)
all_errors = []
Expand All @@ -82,9 +82,7 @@ def oneOf(validator: jsonschema.protocols.Validator, oneOf, instance, schema):
context=all_errors,
)

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

0 comments on commit a56c01e

Please sign in to comment.