public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: dev-python/openapi-schema-validator/, dev-python/openapi-schema-validator/files/
@ 2024-06-16  8:12 Petr Vaněk
  0 siblings, 0 replies; only message in thread
From: Petr Vaněk @ 2024-06-16  8:12 UTC (permalink / raw
  To: gentoo-commits

commit:     d70da39f1d5092b911c83423b3362748ac5edcae
Author:     Petr Vaněk <arkamar <AT> gentoo <DOT> org>
AuthorDate: Sat Jun 15 21:29:11 2024 +0000
Commit:     Petr Vaněk <arkamar <AT> gentoo <DOT> org>
CommitDate: Sun Jun 16 08:11:05 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d70da39f

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 <AT> gentoo.org>

 .../openapi-schema-validator-0.6.2-test.patch      | 24 ++++++++++++++++++++++
 .../openapi-schema-validator-0.6.2.ebuild          |  6 +++++-
 2 files changed, 29 insertions(+), 1 deletion(-)

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
 }


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2024-06-16  8:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-16  8:12 [gentoo-commits] repo/gentoo:master commit in: dev-python/openapi-schema-validator/, dev-python/openapi-schema-validator/files/ Petr Vaněk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox