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

Method test_parametrize_skipif

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

Source from the content-addressed store, hash-verified

592 assert colitems[3].name == "test2[b-c]"
593
594 def test_parametrize_skipif(self, pytester: Pytester) -> None:
595 pytester.makepyfile(
596 """
597 import pytest
598
599 m = pytest.mark.skipif('True')
600
601 @pytest.mark.parametrize('x', [0, 1, pytest.param(2, marks=m)])
602 def test_skip_if(x):
603 assert x < 2
604 """
605 )
606 result = pytester.runpytest()
607 result.stdout.fnmatch_lines(["* 2 passed, 1 skipped in *"])
608
609 def test_parametrize_skip(self, pytester: Pytester) -> None:
610 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