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

Function batch_make_numbered_dirs

testing/_py/test_local.py:547–557  ·  view source on GitHub ↗
(rootdir, repeats)

Source from the content-addressed store, hash-verified

545
546
547def batch_make_numbered_dirs(rootdir, repeats):
548 for i in range(repeats):
549 dir_ = local.make_numbered_dir(prefix="repro-", rootdir=rootdir)
550 file_ = dir_.join("foo")
551 file_.write_text(f"{i}", encoding="utf-8")
552 actual = int(file_.read_text(encoding="utf-8"))
553 assert actual == i, (
554 f"int(file_.read_text(encoding='utf-8')) is {actual} instead of {i}"
555 )
556 dir_.join(".lock").remove(ignore_errors=True)
557 return True
558
559
560class TestLocalPath(CommonFSTests):

Callers

nothing calls this directly

Calls 6

intClass · 0.85
make_numbered_dirMethod · 0.80
joinMethod · 0.80
write_textMethod · 0.80
read_textMethod · 0.80
removeMethod · 0.80

Tested by

no test coverage detected