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

Method test_xfail_using_platform

testing/test_skipping.py:323–336  ·  view source on GitHub ↗

Verify that platform can be used with xfail statements.

(self, pytester: Pytester)

Source from the content-addressed store, hash-verified

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."""
325 item = pytester.getitem(
326 """
327 import pytest
328 @pytest.mark.xfail("platform.platform() == platform.platform()")
329 def test_func():
330 assert 0
331 """
332 )
333 reports = runtestprotocol(item, log=False)
334 assert len(reports) == 3
335 callreport = reports[1]
336 assert callreport.wasxfail
337
338 def test_xfail_xpassed_strict(self, pytester: Pytester) -> None:
339 item = pytester.getitem(

Callers

nothing calls this directly

Calls 2

runtestprotocolFunction · 0.90
getitemMethod · 0.45

Tested by

no test coverage detected