summaryrefslogtreecommitdiff
path: root/dev-python/pytest-forked
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2024-06-11 00:08:05 +0100
committerV3n3RiX <venerix@koprulu.sector>2024-06-11 00:08:05 +0100
commit65ff3cc3bd9c3f8e718a67dfecf1f8215bf5d1d4 (patch)
tree541cbae0eb51d2fdb39d64b3d135d1a6f7994dc8 /dev-python/pytest-forked
parent0aad4cd3e3fe3db90904ffc51b35e4ff160b53c5 (diff)
gentoo auto-resync : 11:06:2024 - 00:08:04
Diffstat (limited to 'dev-python/pytest-forked')
-rw-r--r--dev-python/pytest-forked/Manifest3
-rw-r--r--dev-python/pytest-forked/files/pytest-forked-1.6.0-pytest-8.patch48
-rw-r--r--dev-python/pytest-forked/pytest-forked-1.6.0.ebuild30
3 files changed, 67 insertions, 14 deletions
diff --git a/dev-python/pytest-forked/Manifest b/dev-python/pytest-forked/Manifest
index 8ed0ab1d4e46..5dcc0b069a46 100644
--- a/dev-python/pytest-forked/Manifest
+++ b/dev-python/pytest-forked/Manifest
@@ -1,3 +1,4 @@
+AUX pytest-forked-1.6.0-pytest-8.patch 1946 BLAKE2B e88554cd6d5ef02b65d7d151a37088787d4544dd8911af76acec2a8a71f3a3b285021cf7d4dc8f391b59e6fe0486fff98d9bd00735971c2027976b0b86fa7735 SHA512 f6579af611780216b2c10226edfd24219d1bc801ddd7db8e92313cb8beb82e32d92d919ad15c6d8d646133b5a5143442509d6e9aec42278cf86acf100d56e1ab
DIST pytest-forked-1.6.0.tar.gz 9977 BLAKE2B cfef0ce10c9690894de14ed503ba74244c99c235838039f800b2c26430258e62c98fcc49d9e59b240b2ceee79e467bfbf0da5c96bc4a2d59770ceadd5021a5a9 SHA512 28fedc56fd696a4e7cf528034056849eff14094d5e7f0e94c7c477a7e91e42c08988769cf6f40d25fe8823399e552253cde2198121dd6a9e475fb6a8ce358cad
-EBUILD pytest-forked-1.6.0.ebuild 1178 BLAKE2B befc1b7bda56877dcc71749ff56795830f0793673b4a02d63798e257025dda5d748f532fa0635704ebf1a9d4f2a200ba8e9dbb2856bd19a3f2faf274a47ac848 SHA512 e2f1dcd94fa744f64e58f0f176655d0c6b642a7460b988bbb63961ac0f35f6274235b26685897c476baa53d3112826ed006a114b156dba17bbdf060c0750fef4
+EBUILD pytest-forked-1.6.0.ebuild 1235 BLAKE2B 1a3a3011f0181a73819c88148dea0f60913bb44f73d633f27d95d513c13d6ce4f49ef37acf0cd98c8e409004a0d3743c0adf4e4512a5716a7c4d30ec7a473f41 SHA512 570798040583d4e1d35ce57847741c399e44577506f88cf497cf66540c6e7804a04069b4e748ec77afe247c1bc9e297a9bffc94500e16634ac85f3e5992c4c42
MISC metadata.xml 405 BLAKE2B 8cb6b3e3b440bc53f5d02a9638b00356f64bc02a8d7444ec5e295fcf91507f94c2460acd02008e6b11ca3bc2dd3d2f96ffb61c583fade0ff4ca00a182c01f903 SHA512 4a1dda1d8ada98b57881884ec6e982c308b54ab29e2cfa104f398876a1bd8ee2015dc7de4891c305f65030e30259079667d42c7a80d14d5148feeb5b7cf5904f
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/pytest-forked-1.6.0.ebuild b/dev-python/pytest-forked/pytest-forked-1.6.0.ebuild
index fd67db61e6e9..8771b249acd4 100644
--- a/dev-python/pytest-forked/pytest-forked-1.6.0.ebuild
+++ b/dev-python/pytest-forked/pytest-forked-1.6.0.ebuild
@@ -5,7 +5,7 @@ EAPI=8
DISTUTILS_USE_PEP517=setuptools
PYPI_NO_NORMALIZE=1
-PYTHON_COMPAT=( python3_{10..12} pypy3 )
+PYTHON_COMPAT=( python3_{10..13} pypy3 )
inherit distutils-r1 pypi
@@ -15,8 +15,8 @@ HOMEPAGE="
https://github.com/pytest-dev/pytest-forked/
"
-SLOT="0"
LICENSE="MIT"
+SLOT="0"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86"
# Please do not RDEPEND on pytest; this package won't do anything
@@ -31,16 +31,20 @@ BDEPEND="
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() {
- [[ ${PV} != 1.6.0 ]] && die "Recheck the deselect, please"
- local EPYTEST_DESELECT=()
- if [[ ${EPYTHON} == python3.12 ]]; then
- EPYTEST_DESELECT+=(
- # failing due to warnings coming from pytest
- # https://github.com/gentoo/gentoo/pull/31151
- testing/test_xfail_behavior.py::test_xfail
- )
- fi
-
- epytest -p no:flaky -o tmp_path_retention_count=1
+ local -x PYTEST_DISABLE_PLUGIN_AUTOLOAD=1
+ local -x PYTEST_PLUGINS=pytest_forked
+ epytest -o tmp_path_retention_count=1
}