(tmpdir)
| 780 | |
| 781 | |
| 782 | def 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 | |
| 792 | class MockMain: |