Skip to content

Commit dfb83c2

Browse files
committed
Jsonschema 4.20 prefixItems test fix
1 parent bfffca3 commit dfb83c2

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

tests/integration/test_validators.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -863,5 +863,10 @@ def test_array_prefixitems_invalid(self, validator_class, value):
863863
with pytest.raises(ValidationError) as excinfo:
864864
validator.validate(value)
865865

866-
error = "Expected at most 4 items, but found 5"
867-
assert error in str(excinfo.value)
866+
errors = [
867+
# jsonschema < 4.20.0
868+
"Expected at most 4 items, but found 5",
869+
# jsonschema >= 4.20.0
870+
"Expected at most 4 items but found 1 extra",
871+
]
872+
assert any(error in str(excinfo.value) for error in errors)

0 commit comments

Comments
 (0)