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

Method test_parametrize_xfail

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

Source from the content-addressed store, hash-verified

637 result.stdout.fnmatch_lines(["* 1 failed, 2 passed in *"])
638
639 def test_parametrize_xfail(self, pytester: Pytester) -> None:
640 pytester.makepyfile(
641 """
642 import pytest
643
644 m = pytest.mark.xfail('True')
645
646 @pytest.mark.parametrize('x', [0, 1, pytest.param(2, marks=m)])
647 def test_xfail(x):
648 assert x < 2
649 """
650 )
651 result = pytester.runpytest()
652 result.stdout.fnmatch_lines(["* 2 passed, 1 xfailed in *"])
653
654 def test_parametrize_passed(self, pytester: Pytester) -> None:
655 pytester.makepyfile(

Callers

nothing calls this directly

Calls 3

fnmatch_linesMethod · 0.80
makepyfileMethod · 0.45
runpytestMethod · 0.45

Tested by

no test coverage detected