(
file_path: Path,
parent: Collector,
)
| 120 | |
| 121 | |
| 122 | def pytest_collect_file( |
| 123 | file_path: Path, |
| 124 | parent: Collector, |
| 125 | ) -> Optional[Union["DoctestModule", "DoctestTextfile"]]: |
| 126 | config = parent.config |
| 127 | if file_path.suffix == ".py": |
| 128 | if config.option.doctestmodules and not any( |
| 129 | (_is_setup_py(file_path), _is_main_py(file_path)) |
| 130 | ): |
| 131 | mod: DoctestModule = DoctestModule.from_parent(parent, path=file_path) |
| 132 | return mod |
| 133 | elif _is_doctest(config, file_path, parent): |
| 134 | txt: DoctestTextfile = DoctestTextfile.from_parent(parent, path=file_path) |
| 135 | return txt |
| 136 | return None |
| 137 | |
| 138 | |
| 139 | def _is_setup_py(path: Path) -> bool: |
nothing calls this directly
no test coverage detected