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

Method test_xfail_using_platform

testing/test_skipping.py:329–342  ·  view source on GitHub ↗

Verify that platform can be used with xfail statements.

(self, pytester: Pytester)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

runtestprotocolFunction · 0.90
getitemMethod · 0.45

Tested by

no test coverage detected