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

Method test_skip_file_by_conftest

testing/test_session.py:163–181  ·  view source on GitHub ↗
(self, pytester: Pytester)

Source from the content-addressed store, hash-verified

161 )
162
163 def test_skip_file_by_conftest(self, pytester: Pytester) -> None:
164 pytester.makepyfile(
165 conftest="""
166 import pytest
167 def pytest_collect_file():
168 pytest.skip("intentional")
169 """,
170 test_file="""
171 def test_one(): pass
172 """,
173 )
174 try:
175 reprec = pytester.inline_run(pytester.path)
176 except pytest.skip.Exception: # pragma: no cover
177 pytest.fail("wrong skipped caught")
178 reports = reprec.getreports("pytest_collectreport")
179 # Session, Dir
180 assert len(reports) == 2
181 assert reports[1].skipped
182
183
184class TestNewSession(SessionTests):

Callers

nothing calls this directly

Calls 4

failMethod · 0.80
makepyfileMethod · 0.45
inline_runMethod · 0.45
getreportsMethod · 0.45

Tested by

no test coverage detected