commit:     b2d4a5c51bfba74bd4fdd1019306f0761cbed568
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri May 23 17:16:19 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri May 23 17:16:19 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b2d4a5c5

dev-python/pytest-subprocess: Enable py3.14

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 .../files/pytest-subprocess-1.5.3-py314.patch      | 53 ++++++++++++++++++++++
 .../pytest-subprocess-1.5.3.ebuild                 |  7 ++-
 2 files changed, 59 insertions(+), 1 deletion(-)

diff --git 
a/dev-python/pytest-subprocess/files/pytest-subprocess-1.5.3-py314.patch 
b/dev-python/pytest-subprocess/files/pytest-subprocess-1.5.3-py314.patch
new file mode 100644
index 000000000000..b6c1aa63bfee
--- /dev/null
+++ b/dev-python/pytest-subprocess/files/pytest-subprocess-1.5.3-py314.patch
@@ -0,0 +1,53 @@
+From c9fbd11a1c4caea4b3fbc5114363a1c7fac4af38 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <[email protected]>
+Date: Wed, 21 May 2025 15:29:55 +0200
+Subject: [PATCH] Fix test_examples on Python 3.14
+
+This is basically a followup of 
https://github.com/aklajnert/pytest-subprocess/pull/148
+---
+ tests/test_examples.py | 28 ++++++++++++++++------------
+ 1 file changed, 16 insertions(+), 12 deletions(-)
+
+diff --git a/tests/test_examples.py b/tests/test_examples.py
+index 5a27604..df849f3 100644
+--- a/tests/test_examples.py
++++ b/tests/test_examples.py
+@@ -1,3 +1,4 @@
++import sys
+ from pathlib import Path
+ 
+ import pytest
+@@ -39,18 +40,21 @@ def test_documentation(testdir, rst_file):
+         "    os.chdir(os.path.dirname(__file__))\n\n"
+     )
+ 
+-    event_loop_fixture = (
+-        "\n\n"
+-        "@pytest.fixture(autouse=True)\n"
+-        "def event_loop(request):\n"
+-        "    policy = asyncio.get_event_loop_policy()\n"
+-        '    if sys.platform == "win32":\n'
+-        "        loop = asyncio.ProactorEventLoop()\n"
+-        "    else:\n"
+-        "        loop = policy.get_event_loop()\n"
+-        "    yield loop\n"
+-        "    loop.close()\n"
+-    )
++    if sys.version_info < (3, 8):
++        event_loop_fixture = (
++            "\n\n"
++            "@pytest.fixture(autouse=True)\n"
++            "def event_loop(request):\n"
++            "    policy = asyncio.get_event_loop_policy()\n"
++            '    if sys.platform == "win32":\n'
++            "        loop = asyncio.ProactorEventLoop()\n"
++            "    else:\n"
++            "        loop = policy.get_event_loop()\n"
++            "    yield loop\n"
++            "    loop.close()\n"
++        )
++    else:
++        event_loop_fixture = ""
+ 
+     code_blocks = "\n".join(get_code_blocks(ROOT_DIR / rst_file))
+     testdir.makepyfile(

diff --git a/dev-python/pytest-subprocess/pytest-subprocess-1.5.3.ebuild 
b/dev-python/pytest-subprocess/pytest-subprocess-1.5.3.ebuild
index f27600b7183c..b53c5c39334d 100644
--- a/dev-python/pytest-subprocess/pytest-subprocess-1.5.3.ebuild
+++ b/dev-python/pytest-subprocess/pytest-subprocess-1.5.3.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..14} )
 
 inherit distutils-r1
 
@@ -37,6 +37,11 @@ BDEPEND="
 
 distutils_enable_tests pytest
 
+PATCHES=(
+       # https://github.com/aklajnert/pytest-subprocess/pull/185
+       "${FILESDIR}/${P}-py314.patch"
+)
+
 python_test() {
        local -x PYTEST_DISABLE_PLUGIN_AUTOLOAD=1
        local -x PYTEST_PLUGINS=pytest_subprocess.fixtures,pytest_asyncio.plugin

Reply via email to