MCPcopy
hub / github.com/pytest-dev/pytest / test_skipif_class

Method test_skipif_class

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

evaluate_skip_marksFunction · 0.90
getitemsMethod · 0.45

Tested by

no test coverage detected