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

Function pytest_collect_directory

src/_pytest/python.py:181–192  ·  view source on GitHub ↗
(
    path: Path, parent: nodes.Collector
)

Source from the content-addressed store, hash-verified

179
180
181def pytest_collect_directory(
182 path: Path, parent: nodes.Collector
183) -> nodes.Collector | None:
184 pkginit = path / "__init__.py"
185 try:
186 has_pkginit = pkginit.is_file()
187 except PermissionError:
188 # See https://github.com/pytest-dev/pytest/issues/12120#issuecomment-2106349096.
189 return None
190 if has_pkginit:
191 return Package.from_parent(parent, path=path)
192 return None
193
194
195def pytest_collect_file(file_path: Path, parent: nodes.Collector) -> Module | None:

Callers

nothing calls this directly

Calls 1

from_parentMethod · 0.45

Tested by

no test coverage detected