(tmpdir)
| 771 | |
| 772 | |
| 773 | def 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 | |
| 782 | def test_iter_lazyfile(tmpdir): |