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

Method test_xfail_simple

testing/test_skipping.py:299–312  ·  view source on GitHub ↗
(self, pytester: Pytester, strict: bool)

Source from the content-addressed store, hash-verified

297class TestXFail:
298 @pytest.mark.parametrize("strict", [True, False])
299 def test_xfail_simple(self, pytester: Pytester, strict: bool) -> None:
300 item = pytester.getitem(
301 f"""
302 import pytest
303 @pytest.mark.xfail(strict={strict})
304 def test_func():
305 assert 0
306 """
307 )
308 reports = runtestprotocol(item, log=False)
309 assert len(reports) == 3
310 callreport = reports[1]
311 assert callreport.skipped
312 assert callreport.wasxfail == ""
313
314 def test_xfail_xpassed(self, pytester: Pytester) -> None:
315 item = pytester.getitem(

Callers

nothing calls this directly

Calls 2

runtestprotocolFunction · 0.90
getitemMethod · 0.45

Tested by

no test coverage detected