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

Method test_skipif

testing/test_skipping.py:1253–1270  ·  view source on GitHub ↗
(self, pytester: Pytester)

Source from the content-addressed store, hash-verified

1251
1252class TestBooleanCondition:
1253 def test_skipif(self, pytester: Pytester) -> None:
1254 pytester.makepyfile(
1255 """
1256 import pytest
1257 @pytest.mark.skipif(True, reason="True123")
1258 def test_func1():
1259 pass
1260 @pytest.mark.skipif(False, reason="True123")
1261 def test_func2():
1262 pass
1263 """
1264 )
1265 result = pytester.runpytest()
1266 result.stdout.fnmatch_lines(
1267 """
1268 *1 passed*1 skipped*
1269 """
1270 )
1271
1272 def test_skipif_noreason(self, pytester: Pytester) -> None:
1273 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