diff --git a/pyproject.toml b/pyproject.toml index 3655b5d0..bfcac429 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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", diff --git a/tavern/_core/schema/jsonschema.py b/tavern/_core/schema/jsonschema.py index e8797742..896a80ce 100644 --- a/tavern/_core/schema/jsonschema.py +++ b/tavern/_core/schema/jsonschema.py @@ -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 = [] @@ -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)