MCPcopy
hub / github.com/pytest-dev/pytest / find_prefixed

Function find_prefixed

src/_pytest/pathlib.py:172–177  ·  view source on GitHub ↗

Find all elements in root that begin with the prefix, case-insensitive.

(root: Path, prefix: str)

Source from the content-addressed store, hash-verified

170
171
172def find_prefixed(root: Path, prefix: str) -> Iterator[os.DirEntry[str]]:
173 """Find all elements in root that begin with the prefix, case-insensitive."""
174 l_prefix = prefix.lower()
175 for x in os.scandir(root):
176 if x.name.lower().startswith(l_prefix):
177 yield x
178
179
180def extract_suffixes(iter: Iterable[os.DirEntry[str]], prefix: str) -> Iterator[str]:

Callers 2

find_suffixesFunction · 0.85
cleanup_candidatesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected