gentoo/dev-python/openapi-schema-validator/files/openapi-schema-validator-0.6.2-test.patch
Petr Vaněk d70da39f1d
dev-python/openapi-schema-validator: fix tests
The issue was fixed upstream, see PR [1].

[1] https://github.com/python-openapi/openapi-schema-validator/pull/165

Closes: https://bugs.gentoo.org/923074
Signed-off-by: Petr Vaněk <arkamar@gentoo.org>
2024-06-16 10:11:05 +02:00

25 lines
1.0 KiB
Diff

From dfb83c2961bcb6541c8c5e483f10389c77a4f5a0 Mon Sep 17 00:00:00 2001
From: p1c2u <maciag.artur@gmail.com>
Date: Sat, 16 Mar 2024 17:05:13 +0000
Subject: [PATCH 2/2] Jsonschema 4.20 prefixItems test fix
Upstream-PR: https://github.com/python-openapi/openapi-schema-validator/pull/165
diff --git a/tests/integration/test_validators.py b/tests/integration/test_validators.py
index 07bc4df..07dfaa9 100644
--- a/tests/integration/test_validators.py
+++ b/tests/integration/test_validators.py
@@ -863,5 +863,10 @@ def test_array_prefixitems_invalid(self, validator_class, value):
with pytest.raises(ValidationError) as excinfo:
validator.validate(value)
- error = "Expected at most 4 items, but found 5"
- assert error in str(excinfo.value)
+ errors = [
+ # jsonschema < 4.20.0
+ "Expected at most 4 items, but found 5",
+ # jsonschema >= 4.20.0
+ "Expected at most 4 items but found 1 extra",
+ ]
+ assert any(error in str(excinfo.value) for error in errors)