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

Method test_parametrize_xfail_passed

testing/python/collect.py:669–682  ·  view source on GitHub ↗
(self, pytester: Pytester)

Source from the content-addressed store, hash-verified

667 result.stdout.fnmatch_lines(["* 2 passed, 1 xpassed in *"])
668
669 def test_parametrize_xfail_passed(self, pytester: Pytester) -> None:
670 pytester.makepyfile(
671 """
672 import pytest
673
674 m = pytest.mark.xfail('False')
675
676 @pytest.mark.parametrize('x', [0, 1, m(2)])
677 def test_passed(x):
678 pass
679 """
680 )
681 result = pytester.runpytest()
682 result.stdout.fnmatch_lines(["* 3 passed in *"])
683
684 def test_function_originalname(self, pytester: Pytester) -> None:
685 items = pytester.getitems(

Callers

nothing calls this directly

Calls 3

fnmatch_linesMethod · 0.80
makepyfileMethod · 0.45
runpytestMethod · 0.45

Tested by

no test coverage detected