diff --git a/Fix-test-xfail-behavior-with-pytest-7.2.0+.patch b/Fix-test-xfail-behavior-with-pytest-7.2.0+.patch new file mode 100644 index 0000000000000000000000000000000000000000..4fcfb8894bf4f18e799196973cd08d5ba821809f --- /dev/null +++ b/Fix-test-xfail-behavior-with-pytest-7.2.0+.patch @@ -0,0 +1,35 @@ +diff --git a/testing/test_xfail_behavior.py b/testing/test_xfail_behavior.py +index 8c6e55a..10d65ff 100644 +--- a/testing/test_xfail_behavior.py ++++ b/testing/test_xfail_behavior.py +@@ -6,6 +6,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] + + pytestmark = pytest.mark.skipif( # pylint: disable=invalid-name + not hasattr(os, "fork"), # noqa: WPS421 +@@ -68,10 +69,12 @@ def test_xfail(is_crashing, is_strict, testdir): + ) + ) + reason_string = ( +- " reason: The process gets terminated; " ++ "reason: The process gets terminated; " + "pytest-forked reason: " + "*:*: running the test CRASHED with signal {sig_num:d}".format(**locals()) + ) ++ if expected_lowercase == "xfailed" and PYTEST_GTE_7_2: ++ short_test_summary += " - " + reason_string + total_summary_line = "*==== 1 {expected_lowercase!s} in 0.*s* ====*".format( + **locals() + ) +@@ -95,7 +98,7 @@ def test_xfail(is_crashing, is_strict, testdir): + ) + if expected_lowercase == "xpassed" and expected_word == FAILED_WORD: + # XPASS(strict) +- expected_lines += (reason_string,) ++ expected_lines += (" " + reason_string,) + expected_lines += (total_summary_line,) + + test_module = testdir.makepyfile( diff --git a/python-pytest-forked.spec b/python-pytest-forked.spec index 4b9f736d73d5c4b7f4dd773767b1be0206fbf644..52807e039ce7907fc55223281bc3337a71f1a472 100644 --- a/python-pytest-forked.spec +++ b/python-pytest-forked.spec @@ -1,12 +1,14 @@ %global _empty_manifest_terminate_build 0 Name: python-pytest-forked Version: 1.4.0 -Release: 2 +Release: 3 Summary: run tests in isolated forked subprocesses License: MIT URL: https://github.com/pytest-dev/pytest-forked Source0: https://files.pythonhosted.org/packages/f1/bc/0121a2e386b261b69f4f5aa48e5304c947451dce70d68628cb28d5cd0d28/pytest-forked-1.4.0.tar.gz BuildArch: noarch +Patch01: Fix-test-xfail-behavior-with-pytest-7.2.0+.patch + %description pytest-forked: run each test in a forked subprocess .. warning:: this is a extraction of the xdist --forked module, future maintenance beyond the bare @@ -51,7 +53,7 @@ forked subprocess to survive SEGFAULTS or otherwise dying processes.|python| |version| |ci| |pre-commit| |black|.. |versio .. |ci| image:: . %prep -%autosetup -n pytest-forked-%{version} +%autosetup -n pytest-forked-%{version} -p1 %build %py3_build @@ -87,7 +89,7 @@ mv %{buildroot}/doclist.lst . %check PYTHONPATH=%{buildroot}%{python3_sitelib} py.test-%{python3_version} testing -rm -f %{buildroot}%{python3_sitelib}/pytest_forked/__pycache__/__init__.cpython-310-pytest-6.2.5.pyc +rm -f %{buildroot}%{python3_sitelib}/pytest_forked/__pycache__/__init__.cpython-*-pytest-*.pyc %files -n python3-pytest-forked -f filelist.lst %dir %{python3_sitelib}/* @@ -96,6 +98,9 @@ rm -f %{buildroot}%{python3_sitelib}/pytest_forked/__pycache__/__init__.cpython- %{_docdir}/* %changelog +* Thu May 29 2025 tzing_t - 1.4.0-3 +- Fix build error + * Wed Jun 22 2022 renliang - 1.4.0-2 - To modify check, run check