summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetr Vaněk <arkamar@gentoo.org>2024-06-15 23:29:11 +0200
committerPetr Vaněk <arkamar@gentoo.org>2024-06-16 10:11:05 +0200
commitd70da39f1d5092b911c83423b3362748ac5edcae (patch)
treedccf609b78bfe000ae4707765dce27cd70bdea6c
parentmail-mta/postfix: Stabilize 3.9.0 ppc, #934185 (diff)
downloadgentoo-d70da39f1d5092b911c83423b3362748ac5edcae.tar.gz
gentoo-d70da39f1d5092b911c83423b3362748ac5edcae.tar.bz2
gentoo-d70da39f1d5092b911c83423b3362748ac5edcae.zip
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>
-rw-r--r--dev-python/openapi-schema-validator/files/openapi-schema-validator-0.6.2-test.patch24
-rw-r--r--dev-python/openapi-schema-validator/openapi-schema-validator-0.6.2.ebuild6
2 files changed, 29 insertions, 1 deletions
diff --git a/dev-python/openapi-schema-validator/files/openapi-schema-validator-0.6.2-test.patch b/dev-python/openapi-schema-validator/files/openapi-schema-validator-0.6.2-test.patch
new file mode 100644
index 000000000000..2937a867a1d2
--- /dev/null
+++ b/dev-python/openapi-schema-validator/files/openapi-schema-validator-0.6.2-test.patch
@@ -0,0 +1,24 @@
+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)
diff --git a/dev-python/openapi-schema-validator/openapi-schema-validator-0.6.2.ebuild b/dev-python/openapi-schema-validator/openapi-schema-validator-0.6.2.ebuild
index 4009d1eae1c0..b4e29c5c55b2 100644
--- a/dev-python/openapi-schema-validator/openapi-schema-validator-0.6.2.ebuild
+++ b/dev-python/openapi-schema-validator/openapi-schema-validator-0.6.2.ebuild
@@ -1,4 +1,4 @@
-# Copyright 2022-2023 Gentoo Authors
+# Copyright 2022-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
@@ -28,6 +28,10 @@ RDEPEND="
distutils_enable_tests pytest
src_prepare() {
+ local PATCHES=(
+ "${FILESDIR}/${P}-test.patch"
+ )
+
sed -e '/--cov/d' -i pyproject.toml || die
distutils-r1_src_prepare
}