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

Method test_skip_file_by_conftest

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

Source from the content-addressed store, hash-verified

157 )
158
159 def test_skip_file_by_conftest(self, pytester: Pytester) -> None:
160 pytester.makepyfile(
161 conftest="""
162 import pytest
163 def pytest_collect_file():
164 pytest.skip("intentional")
165 """,
166 test_file="""
167 def test_one(): pass
168 """,
169 )
170 try:
171 reprec = pytester.inline_run(pytester.path)
172 except pytest.skip.Exception: # pragma: no cover
173 pytest.fail("wrong skipped caught")
174 reports = reprec.getreports("pytest_collectreport")
175 assert len(reports) == 1
176 assert reports[0].skipped
177
178
179class 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