(
path: Path, parent: nodes.Collector
)
| 179 | |
| 180 | |
| 181 | def 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 | |
| 195 | def pytest_collect_file(file_path: Path, parent: nodes.Collector) -> Module | None: |
nothing calls this directly
no test coverage detected