MCPcopy Create free account
hub / github.com/pytest-dev/pytest / test_xfail_xpassed

Method test_xfail_xpassed

testing/test_skipping.py:308–321  ·  view source on GitHub ↗
(self, pytester: Pytester)

Source from the content-addressed store, hash-verified

306 assert callreport.wasxfail == ""
307
308 def test_xfail_xpassed(self, pytester: Pytester) -> None:
309 item = pytester.getitem(
310 """
311 import pytest
312 @pytest.mark.xfail(reason="this is an xfail")
313 def test_func():
314 assert 1
315 """
316 )
317 reports = runtestprotocol(item, log=False)
318 assert len(reports) == 3
319 callreport = reports[1]
320 assert callreport.passed
321 assert callreport.wasxfail == "this is an xfail"
322
323 def test_xfail_using_platform(self, pytester: Pytester) -> None:
324 """Verify that platform can be used with xfail statements."""

Callers

nothing calls this directly

Calls 2

runtestprotocolFunction · 0.90
getitemMethod · 0.45

Tested by

no test coverage detected