Skip to content
Myr

test_KeepOpenFile.py

This file

Path

tests/test_utils/test_KeepOpenFile.py

10 lines · 330 bytes · Python

Last changed by

Add files for _detect_program_name, _expand_args, and make_default_short_help.Edward Gbefore adoption47cc96f

History of this file

Take it

1import click234def test_iter_keepopenfile(tmpdir):5    expected = list(map(str, range(10)))6    p = tmpdir.mkdir("testdir").join("testfile")7    p.write("\n".join(expected))8    with p.open() as f:9        for e_line, a_line in zip(expected, click.utils.KeepOpenFile(f), strict=False):10            assert e_line == a_line.strip()