MCPcopy
hub / github.com/pallets/click / test_iter_keepopenfile

Function test_iter_keepopenfile

tests/test_utils.py:773–779  ·  view source on GitHub ↗
(tmpdir)

Source from the content-addressed store, hash-verified

771
772
773def test_iter_keepopenfile(tmpdir):
774 expected = list(map(str, range(10)))
775 p = tmpdir.mkdir("testdir").join("testfile")
776 p.write("\n".join(expected))
777 with p.open() as f:
778 for e_line, a_line in zip(expected, click.utils.KeepOpenFile(f), strict=False):
779 assert e_line == a_line.strip()
780
781
782def test_iter_lazyfile(tmpdir):

Callers

nothing calls this directly

Calls 2

openMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected