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

Method test_skip_in_setup_function

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

Source from the content-addressed store, hash-verified

228 # assert not rep.skipped.failurerepr
229
230 def test_skip_in_setup_function(self, pytester: Pytester) -> None:
231 reports = pytester.runitem(
232 """
233 import pytest
234 def setup_function(func):
235 pytest.skip("hello")
236 def test_func():
237 pass
238 """
239 )
240 print(reports)
241 rep = reports[0]
242 assert not rep.failed
243 assert not rep.passed
244 assert rep.skipped
245 # assert rep.skipped.reason == "hello"
246 # assert rep.skipped.location.lineno == 3
247 # assert rep.skipped.location.lineno == 3
248 assert len(reports) == 2
249 assert reports[1].passed # teardown
250
251 def test_failure_in_setup_function(self, pytester: Pytester) -> None:
252 reports = pytester.runitem(

Callers

nothing calls this directly

Calls 1

runitemMethod · 0.45

Tested by

no test coverage detected