Return the collection node of a file. This is like :py:meth:`getnode` but uses :py:meth:`parseconfigure` to create the (configured) pytest Config instance. :param os.PathLike[str] path: Path to the file.
(self, path: Union[str, "os.PathLike[str]"])
| 983 | return res |
| 984 | |
| 985 | def getpathnode(self, path: Union[str, "os.PathLike[str]"]): |
| 986 | """Return the collection node of a file. |
| 987 | |
| 988 | This is like :py:meth:`getnode` but uses :py:meth:`parseconfigure` to |
| 989 | create the (configured) pytest Config instance. |
| 990 | |
| 991 | :param os.PathLike[str] path: Path to the file. |
| 992 | """ |
| 993 | path = Path(path) |
| 994 | config = self.parseconfigure(path) |
| 995 | session = Session.from_config(config) |
| 996 | x = bestrelpath(session.path, path) |
| 997 | config.hook.pytest_sessionstart(session=session) |
| 998 | res = session.perform_collect([x], genitems=False)[0] |
| 999 | config.hook.pytest_sessionfinish(session=session, exitstatus=ExitCode.OK) |
| 1000 | return res |
| 1001 | |
| 1002 | def genitems(self, colitems: Sequence[Union[Item, Collector]]) -> List[Item]: |
| 1003 | """Generate all test items from a collection node. |
no test coverage detected