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

Function test_iter_lazyfile

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

Source from the content-addressed store, hash-verified

780
781
782def test_iter_lazyfile(tmpdir):
783 expected = list(map(str, range(10)))
784 p = tmpdir.mkdir("testdir").join("testfile")
785 p.write("\n".join(expected))
786 with p.open() as f:
787 with click.utils.LazyFile(f.name) as lf:
788 for e_line, a_line in zip(expected, lf, strict=False):
789 assert e_line == a_line.strip()
790
791
792class MockMain:

Callers

nothing calls this directly

Calls 2

openMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected