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

Method test_skip_in_setup_function

testing/test_runner.py:166–185  ·  view source on GitHub ↗
(self, pytester: Pytester)

Source from the content-addressed store, hash-verified

164 # assert not rep.skipped.failurerepr
165
166 def test_skip_in_setup_function(self, pytester: Pytester) -> None:
167 reports = pytester.runitem(
168 """
169 import pytest
170 def setup_function(func):
171 pytest.skip("hello")
172 def test_func():
173 pass
174 """
175 )
176 print(reports)
177 rep = reports[0]
178 assert not rep.failed
179 assert not rep.passed
180 assert rep.skipped
181 # assert rep.skipped.reason == "hello"
182 # assert rep.skipped.location.lineno == 3
183 # assert rep.skipped.location.lineno == 3
184 assert len(reports) == 2
185 assert reports[1].passed # teardown
186
187 def test_failure_in_setup_function(self, pytester: Pytester) -> None:
188 reports = pytester.runitem(

Callers

nothing calls this directly

Calls 1

runitemMethod · 0.45

Tested by

no test coverage detected