Skip to content

Commit 446ae9e

Browse files
committed
Fix test_edit to work with BSD sed
1 parent 2d3b243 commit 446ae9e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/test_termui.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -386,15 +386,15 @@ def test_fast_edit(runner):
386386
@pytest.mark.skipif(platform.system() == "Windows", reason="No sed on Windows.")
387387
def test_edit(runner):
388388
with tempfile.NamedTemporaryFile(mode="w") as named_tempfile:
389-
named_tempfile.write("a\nb")
389+
named_tempfile.write("a\nb\n")
390390
named_tempfile.flush()
391391

392392
result = click.edit(filename=named_tempfile.name, editor="sed -i~ 's/$/Test/'")
393393
assert result is None
394394

395395
# We need ot reopen the file as it becomes unreadable after the edit.
396396
with open(named_tempfile.name) as reopened_file:
397-
assert reopened_file.read() == "aTest\nbTest"
397+
assert reopened_file.read() == "aTest\nbTest\n"
398398

399399

400400
@pytest.mark.parametrize(

0 commit comments

Comments
 (0)