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 path: Path to the file. :returns: The node.
(self, path: str | os.PathLike[str])
| 1010 | return res |
| 1011 | |
| 1012 | def getpathnode(self, path: str | os.PathLike[str]) -> Collector | Item: |
| 1013 | class="st">"""Return the collection node of a file. |
| 1014 | |
| 1015 | This is like :py:meth:`getnode` but uses :py:meth:`parseconfigure` to |
| 1016 | create the (configured) pytest Config instance. |
| 1017 | |
| 1018 | :param path: |
| 1019 | Path to the file. |
| 1020 | :returns: |
| 1021 | The node. |
| 1022 | class="st">""" |
| 1023 | path = Path(path) |
| 1024 | config = self.parseconfigure(path) |
| 1025 | session = Session.from_config(config) |
| 1026 | x = bestrelpath(session.path, path) |
| 1027 | config.hook.pytest_sessionstart(session=session) |
| 1028 | res = session.perform_collect([x], genitems=False)[0] |
| 1029 | config.hook.pytest_sessionfinish(session=session, exitstatus=ExitCode.OK) |
| 1030 | return res |
| 1031 | |
| 1032 | def genitems(self, colitems: Sequence[Item | Collector]) -> list[Item]: |
| 1033 | class="st">"""Generate all test items from a collection node. |
no test coverage detected