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

Method test_skipif_reporting

testing/test_skipping.py:901–913  ·  view source on GitHub ↗
(self, pytester: Pytester, params)

Source from the content-addressed store, hash-verified

899 "params", ["\"hasattr(sys, 'platform')\"", 'True, reason="invalid platform"']
900 )
901 def test_skipif_reporting(self, pytester: Pytester, params) -> None:
902 p = pytester.makepyfile(
903 test_foo="""
904 import pytest
905 @pytest.mark.skipif(%(params)s)
906 def test_that():
907 assert 0
908 """
909 % dict(params=params)
910 )
911 result = pytester.runpytest(p, "-s", "-rs")
912 result.stdout.fnmatch_lines(["*SKIP*1*test_foo.py*platform*", "*1 skipped*"])
913 assert result.ret == 0
914
915 def test_skipif_using_platform(self, pytester: Pytester) -> None:
916 item = pytester.getitem(

Callers

nothing calls this directly

Calls 3

fnmatch_linesMethod · 0.80
makepyfileMethod · 0.45
runpytestMethod · 0.45

Tested by

no test coverage detected