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

Method test_skipif_class

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

Source from the content-addressed store, hash-verified

142 assert "INVALID" in excinfo.value.msg
143
144 def test_skipif_class(self, pytester: Pytester) -> None:
145 (item,) = pytester.getitems(
146 """
147 import pytest
148 class TestClass(object):
149 pytestmark = pytest.mark.skipif("config._hackxyz")
150 def test_func(self):
151 pass
152 """
153 )
154 item.config._hackxyz = 3 # type: ignore[attr-defined]
155 skipped = evaluate_skip_marks(item)
156 assert skipped
157 assert skipped.reason == "condition: config._hackxyz"
158
159 def test_skipif_markeval_namespace(self, pytester: Pytester) -> None:
160 pytester.makeconftest(

Callers

nothing calls this directly

Calls 2

evaluate_skip_marksFunction · 0.90
getitemsMethod · 0.45

Tested by

no test coverage detected