summaryrefslogtreecommitdiff
path: root/dev-python/pytest-forked
diff options
context:
space:
mode:
Diffstat (limited to 'dev-python/pytest-forked')
-rw-r--r--dev-python/pytest-forked/files/pytest-forked-1.6.0-pytest-8.patch10
-rw-r--r--dev-python/pytest-forked/files/pytest-forked-1.6.0-pytest-9.patch28
-rw-r--r--dev-python/pytest-forked/pytest-forked-1.6.0.ebuild22
3 files changed, 44 insertions, 16 deletions
diff --git a/dev-python/pytest-forked/files/pytest-forked-1.6.0-pytest-8.patch b/dev-python/pytest-forked/files/pytest-forked-1.6.0-pytest-8.patch
index 889405c00fad..2cdbfb8ae6b7 100644
--- a/dev-python/pytest-forked/files/pytest-forked-1.6.0-pytest-8.patch
+++ b/dev-python/pytest-forked/files/pytest-forked-1.6.0-pytest-8.patch
@@ -1,3 +1,7 @@
+https://github.com/pytest-dev/pytest-forked/issues/89
+https://github.com/pytest-dev/pytest-forked/pull/90
+https://github.com/pytest-dev/pytest-forked/commit/b2742322d39ebda97d5170922520f3bb9c73f614
+
From 398f003660dda242b97217390718a2a90c3d7a88 Mon Sep 17 00:00:00 2001
From: Stanislav Levin <slev@altlinux.org>
Date: Tue, 13 Feb 2024 12:44:53 +0300
@@ -10,12 +14,6 @@ https://docs.pytest.org/en/stable/changelog.html#pytest-8-0-0rc2-2024-01-17
Fixes: https://github.com/pytest-dev/pytest-forked/issues/89
Signed-off-by: Stanislav Levin <slev@altlinux.org>
----
- testing/test_xfail_behavior.py | 11 +++++------
- 1 file changed, 5 insertions(+), 6 deletions(-)
-
-diff --git a/testing/test_xfail_behavior.py b/testing/test_xfail_behavior.py
-index 15edd93..d4e5ee7 100644
--- a/testing/test_xfail_behavior.py
+++ b/testing/test_xfail_behavior.py
@@ -7,6 +7,7 @@ import pytest
diff --git a/dev-python/pytest-forked/files/pytest-forked-1.6.0-pytest-9.patch b/dev-python/pytest-forked/files/pytest-forked-1.6.0-pytest-9.patch
new file mode 100644
index 000000000000..8b3cb5c7c888
--- /dev/null
+++ b/dev-python/pytest-forked/files/pytest-forked-1.6.0-pytest-9.patch
@@ -0,0 +1,28 @@
+https://bugs.gentoo.org/754165
+https://github.com/pytest-dev/pytest-forked/pull/96
+https://github.com/pytest-dev/pytest-forked/commit/8f59f07681757446a7fdf67c998fffd90fd8029e
+
+From 8f59f07681757446a7fdf67c998fffd90fd8029e Mon Sep 17 00:00:00 2001
+From: Scott Talbert <swt@techie.net>
+Date: Tue, 10 Feb 2026 09:42:39 -0500
+Subject: [PATCH] Adapt tests to pytest 9 output format (#96)
+
+--- a/testing/test_xfail_behavior.py
++++ b/testing/test_xfail_behavior.py
+@@ -8,6 +8,7 @@
+ FAILED_WORD = "FAILED" if IS_PYTEST4_PLUS else "FAIL"
+ PYTEST_GTE_7_2 = hasattr(pytest, "version_tuple") and pytest.version_tuple >= (7, 2) # type: ignore[attr-defined]
+ PYTEST_GTE_8_0 = hasattr(pytest, "version_tuple") and pytest.version_tuple >= (8, 0) # type: ignore[attr-defined]
++PYTEST_GTE_9_0 = hasattr(pytest, "version_tuple") and pytest.version_tuple >= (9, 0) # type: ignore[attr-defined]
+
+ pytestmark = pytest.mark.skipif( # pylint: disable=invalid-name
+ not hasattr(os, "fork"), # noqa: WPS421
+@@ -72,6 +73,8 @@ def test_xfail(is_crashing, is_strict, testdir):
+ )
+ if expected_lowercase == "xfailed" and PYTEST_GTE_7_2:
+ short_test_summary += " - " + reason_string
++ if expected_lowercase == "failed" and PYTEST_GTE_9_0:
++ short_test_summary += " - [XPASS(strict)] The process gets termin..."
+ total_summary_line = f"*==== 1 {expected_lowercase!s} in 0.*s* ====*"
+
+ expected_lines = (
diff --git a/dev-python/pytest-forked/pytest-forked-1.6.0.ebuild b/dev-python/pytest-forked/pytest-forked-1.6.0.ebuild
index c079c4aaf6ab..63cfed148a8a 100644
--- a/dev-python/pytest-forked/pytest-forked-1.6.0.ebuild
+++ b/dev-python/pytest-forked/pytest-forked-1.6.0.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2025 Gentoo Authors
+# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
@@ -29,22 +29,24 @@ BDEPEND="
dev-python/setuptools-scm[${PYTHON_USEDEP}]
"
+EPYTEST_PLUGINS=( ${PN} )
+EPYTEST_PLUGIN_LOAD_VIA_ENV=1
distutils_enable_tests pytest
-src_prepare() {
- local PATCHES=(
- # https://github.com/pytest-dev/pytest-forked/pull/90
- "${FILESDIR}/${P}-pytest-8.patch"
- )
+PATCHES=(
+ # backports from master branch
+ "${FILESDIR}/${P}-pytest-8.patch"
+ "${FILESDIR}/${P}-pytest-9.patch"
+)
- distutils-r1_src_prepare
+python_prepare_all() {
+ distutils-r1_python_prepare_all
# this is not printed when loaded via PYTEST_PLUGINS
- sed -i -e '/loaded_pytest_plugins/d' testing/test_xfail_behavior.py || die
+ sed -e '/loaded_pytest_plugins/d' -i testing/test_xfail_behavior.py || die
}
python_test() {
- local -x PYTEST_DISABLE_PLUGIN_AUTOLOAD=1
- local -x PYTEST_PLUGINS=pytest_forked
+ local -x COLUMNS=80 # tests check output bug #754165
epytest -o tmp_path_retention_count=1
}