Skip to content

Commit

Permalink
Merge pull request #90 from stanislavlevin/issue_89
Browse files Browse the repository at this point in the history
Sync expected test_xfail's xpassed summary to Pytest 8
  • Loading branch information
webknjaz authored Feb 13, 2024
2 parents d9d05e2 + 398f003 commit b274232
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions testing/test_xfail_behavior.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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: "
Expand Down

0 comments on commit b274232

Please sign in to comment.