| 531 | return path_ in self._initialpaths |
| 532 | |
| 533 | def gethookproxy(self, fspath: "os.PathLike[str]"): |
| 534 | # Optimization: Path(Path(...)) is much slower than isinstance. |
| 535 | path = fspath if isinstance(fspath, Path) else Path(fspath) |
| 536 | pm = self.config.pluginmanager |
| 537 | # Check if we have the common case of running |
| 538 | # hooks with all conftest.py files. |
| 539 | my_conftestmodules = pm._getconftestmodules( |
| 540 | path, |
| 541 | self.config.getoption("importmode"), |
| 542 | rootpath=self.config.rootpath, |
| 543 | ) |
| 544 | remove_mods = pm._conftest_plugins.difference(my_conftestmodules) |
| 545 | if remove_mods: |
| 546 | # One or more conftests are not in use at this fspath. |
| 547 | from .config.compat import PathAwareHookProxy |
| 548 | |
| 549 | proxy = PathAwareHookProxy(FSHookProxy(pm, remove_mods)) |
| 550 | else: |
| 551 | # All plugins are active for this fspath. |
| 552 | proxy = self.config.hook |
| 553 | return proxy |
| 554 | |
| 555 | def _recurse(self, direntry: "os.DirEntry[str]") -> bool: |
| 556 | if direntry.name == "__pycache__": |