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/Manifest1
-rw-r--r--dev-python/pytest-forked/files/pytest-forked-1.6.0-pytest-8.patch48
-rw-r--r--dev-python/pytest-forked/metadata.xml10
-rw-r--r--dev-python/pytest-forked/pytest-forked-1.6.0.ebuild50
4 files changed, 109 insertions, 0 deletions
diff --git a/dev-python/pytest-forked/Manifest b/dev-python/pytest-forked/Manifest
new file mode 100644
index 000000000000..e09cede00fd1
--- /dev/null
+++ b/dev-python/pytest-forked/Manifest
@@ -0,0 +1 @@
+DIST pytest-forked-1.6.0.tar.gz 9977 BLAKE2B cfef0ce10c9690894de14ed503ba74244c99c235838039f800b2c26430258e62c98fcc49d9e59b240b2ceee79e467bfbf0da5c96bc4a2d59770ceadd5021a5a9 SHA512 28fedc56fd696a4e7cf528034056849eff14094d5e7f0e94c7c477a7e91e42c08988769cf6f40d25fe8823399e552253cde2198121dd6a9e475fb6a8ce358cad
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
new file mode 100644
index 000000000000..889405c00fad
--- /dev/null
+++ b/dev-python/pytest-forked/files/pytest-forked-1.6.0-pytest-8.patch
@@ -0,0 +1,48 @@
+From 398f003660dda242b97217390718a2a90c3d7a88 Mon Sep 17 00:00:00 2001
+From: Stanislav Levin <slev@altlinux.org>
+Date: Tue, 13 Feb 2024 12:44:53 +0300
+Subject: [PATCH] Sync expected test_xfail's xpassed summary to Pytest 8
+
+With Pytest 8:
+https://docs.pytest.org/en/stable/changelog.html#pytest-8-0-0rc2-2024-01-17
+
+> For xpasses, add - in summary between test name and reason, to match how xfail is displayed.
+
+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
+ IS_PYTEST4_PLUS = int(pytest.__version__[0]) >= 4 # noqa: WPS609
+ 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]
+
+ pytestmark = pytest.mark.skipif( # pylint: disable=invalid-name
+ not hasattr(os, "fork"), # noqa: WPS421
+@@ -60,12 +61,10 @@ def test_xfail(is_crashing, is_strict, testdir):
+ if expected_lowercase == "xpassed":
+ # XPASS wouldn't have the crash message from
+ # pytest-forked because the crash doesn't happen
+- short_test_summary = " ".join(
+- (
+- short_test_summary,
+- "The process gets terminated",
+- )
+- )
++ if PYTEST_GTE_8_0:
++ short_test_summary += " -"
++ short_test_summary += " The process gets terminated"
++
+ reason_string = (
+ f"reason: The process gets terminated; "
+ f"pytest-forked reason: "
+--
+2.45.2
+
diff --git a/dev-python/pytest-forked/metadata.xml b/dev-python/pytest-forked/metadata.xml
new file mode 100644
index 000000000000..5e95859f915a
--- /dev/null
+++ b/dev-python/pytest-forked/metadata.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://docs.baldeagleos.com/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>python@gentoo.org</email>
+ <name>Python</name>
+ </maintainer>
+ <stabilize-allarches />
+ <origin>baldeagleos-repo</origin>
+</pkgmetadata>
diff --git a/dev-python/pytest-forked/pytest-forked-1.6.0.ebuild b/dev-python/pytest-forked/pytest-forked-1.6.0.ebuild
new file mode 100644
index 000000000000..c079c4aaf6ab
--- /dev/null
+++ b/dev-python/pytest-forked/pytest-forked-1.6.0.ebuild
@@ -0,0 +1,50 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_USE_PEP517=setuptools
+PYPI_NO_NORMALIZE=1
+PYTHON_COMPAT=( python3_{13..14} )
+
+inherit distutils-r1 pypi
+
+DESCRIPTION="Run tests in isolated forked subprocesses"
+HOMEPAGE="
+ https://pypi.org/project/pytest-forked/
+ https://github.com/pytest-dev/pytest-forked/
+"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~alpha amd64 arm arm64 ~hppa ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 ~sparc x86"
+
+# Please do not RDEPEND on pytest; this package won't do anything
+# without pytest installed, and there is no reason to force older
+# implementations on pytest.
+RDEPEND="
+ dev-python/py[${PYTHON_USEDEP}]
+"
+BDEPEND="
+ dev-python/setuptools-scm[${PYTHON_USEDEP}]
+"
+
+distutils_enable_tests pytest
+
+src_prepare() {
+ local PATCHES=(
+ # https://github.com/pytest-dev/pytest-forked/pull/90
+ "${FILESDIR}/${P}-pytest-8.patch"
+ )
+
+ distutils-r1_src_prepare
+
+ # this is not printed when loaded via PYTEST_PLUGINS
+ sed -i -e '/loaded_pytest_plugins/d' testing/test_xfail_behavior.py || die
+}
+
+python_test() {
+ local -x PYTEST_DISABLE_PLUGIN_AUTOLOAD=1
+ local -x PYTEST_PLUGINS=pytest_forked
+ epytest -o tmp_path_retention_count=1
+}