MCPcopy
hub / github.com/pytest-dev/pytest / test_xfail_xpassed

Method test_xfail_xpassed

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

Source from the content-addressed store, hash-verified

312 assert callreport.wasxfail == ""
313
314 def test_xfail_xpassed(self, pytester: Pytester) -> None:
315 item = pytester.getitem(
316 """
317 import pytest
318 @pytest.mark.xfail(reason="this is an xfail")
319 def test_func():
320 assert 1
321 """
322 )
323 reports = runtestprotocol(item, log=False)
324 assert len(reports) == 3
325 callreport = reports[1]
326 assert callreport.passed
327 assert callreport.wasxfail == "this is an xfail"
328
329 def test_xfail_using_platform(self, pytester: Pytester) -> None:
330 """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