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

Function parse_num

src/_pytest/pathlib.py:196–201  ·  src/_pytest/pathlib.py::parse_num

Parse number path suffixes, returns -1 on error.

(maybe_num: str)

Source from the content-addressed store, hash-verified

194
195
196def parse_num(maybe_num: str) -> int:
197 class="st">""class="st">"Parse number path suffixes, returns -1 on error."class="st">""
198 try:
199 return int(maybe_num)
200 except ValueError:
201 return -1
202
203
204def _force_symlink(root: Path, target: str | PurePath, link_to: str | Path) -> None:

Callers 1

make_numbered_dirMethod · 0.85

Calls 1

intClass · 0.85

Tested by

no test coverage detected