[packages/python3-pytest-forked] - up to 1.6.0

baggins baggins at pld-linux.org
Sat Mar 15 23:43:37 CET 2025


commit 3fffb6713edac3de568dbfdf62a6165ec23c898d
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Sun Mar 16 00:43:06 2025 +0100

    - up to 1.6.0

 pytest8.patch              |  45 ++++++++++++++++++
 python-pytest-forked.spec  | 115 ---------------------------------------------
 python3-pytest-forked.spec |  61 ++++++++++++++++++++++++
 3 files changed, 106 insertions(+), 115 deletions(-)
---
diff --git a/python-pytest-forked.spec b/python-pytest-forked.spec
deleted file mode 100644
index c00c4c4..0000000
--- a/python-pytest-forked.spec
+++ /dev/null
@@ -1,115 +0,0 @@
-#
-# Conditional build:
-%bcond_without	tests	# unit tests
-%bcond_without	python2 # CPython 2.x module
-%bcond_without	python3 # CPython 3.x module
-
-Summary:	Run each test in a forked subprocess
-Summary(pl.UTF-8):	Uruchamianie każdego testu w oddzielnym procesie
-Name:		python-pytest-forked
-# keep 1.3.x here for python2 support
-Version:	1.3.0
-Release:	5
-License:	MIT
-Group:		Libraries/Python
-#Source0Download: https://pypi.org/simple/pytest-forked/
-Source0:	https://files.pythonhosted.org/packages/source/p/pytest-forked/pytest-forked-%{version}.tar.gz
-# Source0-md5:	7de04c46b48ca5c5a24e45bf1546355f
-URL:		https://github.com/pytest-dev/pytest-forked
-%if %{with python2}
-BuildRequires:	python-modules >= 1:2.7
-BuildRequires:	python-setuptools >= 1:41.4
-BuildRequires:	python-setuptools_scm >= 3.3
-%if %{with tests}
-BuildRequires:	python-py
-BuildRequires:	python-pytest >= 3.10
-%endif
-%endif
-%if %{with python3}
-BuildRequires:	python3-modules >= 1:3.5
-BuildRequires:	python3-setuptools >= 1:41.4
-BuildRequires:	python3-setuptools_scm >= 3.3
-%if %{with tests}
-BuildRequires:	python3-py
-BuildRequires:	python3-pytest >= 3.10
-%endif
-%endif
-BuildRequires:	rpm-pythonprov
-BuildRequires:	rpmbuild(macros) >= 1.714
-Requires:	python-modules >= 1:2.7
-BuildArch:	noarch
-BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
-
-%description
-Run each test in a forked subprocess.
-
-%description -l pl.UTF-8
-Uruchamianie każdego testu w oddzielnym procesie.
-
-%package -n python3-pytest-forked
-Summary:	Run each test in a forked subprocess
-Summary(pl.UTF-8):	Uruchamianie każdego testu w oddzielnym procesie
-Group:		Libraries/Python
-Requires:	python3-modules >= 1:3.5
-
-%description -n python3-pytest-forked
-Run each test in a forked subprocess.
-
-%description -n python3-pytest-forked -l pl.UTF-8
-Uruchamianie każdego testu w oddzielnym procesie.
-
-%prep
-%setup -q -n pytest-forked-%{version}
-
-%build
-%if %{with python2}
-%py_build
-
-%if %{with tests}
-# pytest-flaky plugin breaks test_functional_boxed_capturing;
-# test_xfail relies on plugin autoloading, so can't PYTEST_DISABLE_PLUGIN_AUTOLOAD=1
-PYTHONPATH=$(pwd)/src \
-%{__python} -m pytest -p no:flaky testing
-%endif
-%endif
-
-%if %{with python3}
-%py3_build
-
-%if %{with tests}
-PYTHONPATH=$(pwd)/src \
-%{__python3} -m pytest -p no:flaky testing
-%endif
-%endif
-
-%install
-rm -rf $RPM_BUILD_ROOT
-
-%if %{with python2}
-%py_install
-
-%py_postclean
-%endif
-
-%if %{with python3}
-%py3_install
-%endif
-
-%clean
-rm -rf $RPM_BUILD_ROOT
-
-%if %{with python2}
-%files
-%defattr(644,root,root,755)
-%doc CHANGELOG LICENSE README.rst example/boxed.txt
-%{py_sitescriptdir}/pytest_forked
-%{py_sitescriptdir}/pytest_forked-%{version}-py*.egg-info
-%endif
-
-%if %{with python3}
-%files -n python3-pytest-forked
-%defattr(644,root,root,755)
-%doc CHANGELOG LICENSE README.rst example/boxed.txt
-%{py3_sitescriptdir}/pytest_forked
-%{py3_sitescriptdir}/pytest_forked-%{version}-py*.egg-info
-%endif
diff --git a/python3-pytest-forked.spec b/python3-pytest-forked.spec
new file mode 100644
index 0000000..760b9b0
--- /dev/null
+++ b/python3-pytest-forked.spec
@@ -0,0 +1,61 @@
+#
+# Conditional build:
+%bcond_without	tests	# unit tests
+
+Summary:	Run each test in a forked subprocess
+Summary(pl.UTF-8):	Uruchamianie każdego testu w oddzielnym procesie
+Name:		python3-pytest-forked
+# keep 1.3.x here for python2 support
+Version:	1.6.0
+Release:	1
+License:	MIT
+Group:		Libraries/Python
+#Source0Download: https://pypi.org/simple/pytest-forked/
+Source0:	https://files.pythonhosted.org/packages/source/p/pytest-forked/pytest-forked-%{version}.tar.gz
+# Source0-md5:	c2c026fc5bc4ad54649d7f85e36a62ec
+Patch0:		pytest8.patch
+URL:		https://github.com/pytest-dev/pytest-forked
+BuildRequires:	python3-modules >= 1:3.5
+BuildRequires:	python3-setuptools >= 1:41.4
+BuildRequires:	python3-setuptools_scm >= 3.3
+%if %{with tests}
+BuildRequires:	python3-py
+BuildRequires:	python3-pytest >= 3.10
+%endif
+BuildRequires:	rpm-pythonprov
+BuildRequires:	rpmbuild(macros) >= 1.714
+Requires:	python-modules >= 1:2.7
+BuildArch:	noarch
+BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+Run each test in a forked subprocess.
+
+%description -l pl.UTF-8
+Uruchamianie każdego testu w oddzielnym procesie.
+
+%prep
+%setup -q -n pytest-forked-%{version}
+%patch -P 0 -p1
+
+%build
+%py3_build
+
+%if %{with tests}
+PYTHONPATH=$(pwd)/src \
+%{__python3} -m pytest -p no:flaky testing
+%endif
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+%py3_install
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(644,root,root,755)
+%doc CHANGELOG.rst LICENSE README.rst example/boxed.txt
+%{py3_sitescriptdir}/pytest_forked
+%{py3_sitescriptdir}/pytest_forked-%{version}-py*.egg-info
diff --git a/pytest8.patch b/pytest8.patch
new file mode 100644
index 0000000..ffe48a1
--- /dev/null
+++ b/pytest8.patch
@@ -0,0 +1,45 @@
+From 398f003660dda242b97217390718a2a90c3d7a88 Mon Sep 17 00:00:00 2001
+From: Stanislav Levin <slev at 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 at 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 @@
+ 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: "
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python3-pytest-forked.git/commitdiff/3fffb6713edac3de568dbfdf62a6165ec23c898d



More information about the pld-cvs-commit mailing list