Skip to content

Commit b274232

Browse files
authored
Merge pull request #90 from stanislavlevin/issue_89
Sync expected test_xfail's xpassed summary to Pytest 8
2 parents d9d05e2 + 398f003 commit b274232

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

testing/test_xfail_behavior.py

+5-6
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
IS_PYTEST4_PLUS = int(pytest.__version__[0]) >= 4 # noqa: WPS609
88
FAILED_WORD = "FAILED" if IS_PYTEST4_PLUS else "FAIL"
99
PYTEST_GTE_7_2 = hasattr(pytest, "version_tuple") and pytest.version_tuple >= (7, 2) # type: ignore[attr-defined]
10+
PYTEST_GTE_8_0 = hasattr(pytest, "version_tuple") and pytest.version_tuple >= (8, 0) # type: ignore[attr-defined]
1011

1112
pytestmark = pytest.mark.skipif( # pylint: disable=invalid-name
1213
not hasattr(os, "fork"), # noqa: WPS421
@@ -60,12 +61,10 @@ def test_xfail(is_crashing, is_strict, testdir):
6061
if expected_lowercase == "xpassed":
6162
# XPASS wouldn't have the crash message from
6263
# pytest-forked because the crash doesn't happen
63-
short_test_summary = " ".join(
64-
(
65-
short_test_summary,
66-
"The process gets terminated",
67-
)
68-
)
64+
if PYTEST_GTE_8_0:
65+
short_test_summary += " -"
66+
short_test_summary += " The process gets terminated"
67+
6968
reason_string = (
7069
f"reason: The process gets terminated; "
7170
f"pytest-forked reason: "

0 commit comments

Comments
 (0)