| 729 | return path_ in self._initialpaths |
| 730 | |
| 731 | def gethookproxy(self, fspath: os.PathLike[str]) -> pluggy.HookRelay: |
| 732 | # Optimization: Path(Path(...)) is much slower than isinstance. |
| 733 | path = fspath if isinstance(fspath, Path) else Path(fspath) |
| 734 | pm = self.config.pluginmanager |
| 735 | # Check if we have the common case of running |
| 736 | # hooks with all conftest.py files. |
| 737 | my_conftestmodules = pm._getconftestmodules(path) |
| 738 | remove_mods = pm._conftest_plugins.difference(my_conftestmodules) |
| 739 | proxy: pluggy.HookRelay |
| 740 | if remove_mods: |
| 741 | # One or more conftests are not in use at this path. |
| 742 | proxy = FSHookProxy(pm, remove_mods) # type: ignore[assignment] |
| 743 | else: |
| 744 | # All plugins are active for this fspath. |
| 745 | proxy = self.config.hook |
| 746 | return proxy |
| 747 | |
| 748 | def _collect_path( |
| 749 | self, |