commit:     77609e908d955f950277d9d9256316443586e2e2
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon May 12 10:00:21 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon May 12 10:02:54 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=77609e90

dev-python/flasgger: fix tests w/ click-8.2

Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../files/flasgger-0.9.7.1-click-8.2.patch         | 36 ++++++++++++++++++++++
 dev-python/flasgger/flasgger-0.9.7.1.ebuild        |  7 ++++-
 2 files changed, 42 insertions(+), 1 deletion(-)

diff --git a/dev-python/flasgger/files/flasgger-0.9.7.1-click-8.2.patch 
b/dev-python/flasgger/files/flasgger-0.9.7.1-click-8.2.patch
new file mode 100644
index 000000000000..e66324012d0a
--- /dev/null
+++ b/dev-python/flasgger/files/flasgger-0.9.7.1-click-8.2.patch
@@ -0,0 +1,36 @@
+https://github.com/flasgger/flasgger/pull/633
+
+From 08591b60e988c0002fcf1b1e9f98b78e041d2732 Mon Sep 17 00:00:00 2001
+From: Colin Watson <[email protected]>
+Date: Tue, 4 Mar 2025 10:13:55 +0000
+Subject: [PATCH] Fix tests with Click 8.2
+
+https://github.com/pallets/click/pull/2523 introduced changes to
+`click.testing` that broke a few unit tests in Flasgger:
+`mix_stderr=False` is now effectively the default and can no longer be
+specified explicitly.  Although this Click version hasn't been fully
+released yet, this adjusts Flasgger to work with both old and new
+versions.
+--- a/tests/conftest.py
++++ b/tests/conftest.py
+@@ -1,7 +1,9 @@
++import inspect
+ import json
+ import random
+ 
+ import pytest
++from click.testing import CliRunner
+ from flasgger import Swagger
+ from flasgger.utils import get_examples
+ 
+@@ -99,4 +101,8 @@ def app():
+ 
+ @pytest.fixture(scope="function")
+ def cli_runner(app):
+-    yield app.test_cli_runner(mix_stderr=False)
++    kwargs = {}
++    if "mix_stderr" in inspect.signature(CliRunner).parameters:
++        # click < 8.2
++        kwargs["mix_stderr"] = False
++    yield app.test_cli_runner(**kwargs)
+

diff --git a/dev-python/flasgger/flasgger-0.9.7.1.ebuild 
b/dev-python/flasgger/flasgger-0.9.7.1.ebuild
index 3e1049f77420..9f23583fe329 100644
--- a/dev-python/flasgger/flasgger-0.9.7.1.ebuild
+++ b/dev-python/flasgger/flasgger-0.9.7.1.ebuild
@@ -4,7 +4,7 @@
 EAPI=8
 
 DISTUTILS_USE_PEP517=setuptools
-PYTHON_COMPAT=( pypy3 pypy3_11 python3_{10..13} )
+PYTHON_COMPAT=( pypy3_11 python3_{11..13} )
 
 inherit distutils-r1 pypi
 
@@ -27,6 +27,11 @@ RDEPEND="
        dev-python/packaging[${PYTHON_USEDEP}]
 "
 
+PATCHES=(
+       # https://github.com/flasgger/flasgger/pull/633
+       "${FILESDIR}/${PN}-0.9.7.1-click-8.2.patch"
+)
+
 distutils_enable_tests pytest
 
 python_test() {

Reply via email to