(
self, fspath: Path, handle_dupes: bool = True
)
| 702 | return True |
| 703 | |
| 704 | def _collectfile( |
| 705 | self, fspath: Path, handle_dupes: bool = True |
| 706 | ) -> Sequence[nodes.Collector]: |
| 707 | assert ( |
| 708 | fspath.is_file() |
| 709 | ), "{!r} is not a file (isdir={!r}, exists={!r}, islink={!r})".format( |
| 710 | fspath, fspath.is_dir(), fspath.exists(), fspath.is_symlink() |
| 711 | ) |
| 712 | ihook = self.session.gethookproxy(fspath) |
| 713 | if not self.session.isinitpath(fspath): |
| 714 | if ihook.pytest_ignore_collect(collection_path=fspath, config=self.config): |
| 715 | return () |
| 716 | |
| 717 | if handle_dupes: |
| 718 | keepduplicates = self.config.getoption("keepduplicates") |
| 719 | if not keepduplicates: |
| 720 | duplicate_paths = self.config.pluginmanager._duplicatepaths |
| 721 | if fspath in duplicate_paths: |
| 722 | return () |
| 723 | else: |
| 724 | duplicate_paths.add(fspath) |
| 725 | |
| 726 | return ihook.pytest_collect_file(file_path=fspath, parent=self) # type: ignore[no-any-return] |
| 727 | |
| 728 | def collect(self) -> Iterable[Union[nodes.Item, nodes.Collector]]: |
| 729 | this_path = self.path.parent |
no test coverage detected