Skip to content

Commit ba7db80

Browse files
author
Drew O'Meara
committed
added Flush kwarg to print test
1 parent 7d2a8d9 commit ba7db80

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

builtin/tests/builtin.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -323,16 +323,16 @@ def gen2():
323323
assert ok, "AttributeError not raised"
324324

325325
with open("testfile", "w") as f:
326-
print("hello", "world", sep=", ", end="!\n", file=f)
327-
print("hells", "bells", end="...", file=f, sep="_")
326+
print("hello", "world", end="!\n", file=f, sep=", ")
327+
print("hells", "bells", end="...", file=f)
328328
print(" ~", "Brother ", "Foo", "bar", file=f, end="", sep="")
329329

330330
with open("testfile", "r") as f:
331-
assert f.read() == "hello, world!\nhells_bells... ~Brother Foobar"
331+
assert f.read() == "hello, world!\nhells bells... ~Brother Foobar"
332332

333333
with open("testfile", "w") as f:
334-
print(1,2,3,sep=",",end=",\n", file=f)
335-
print("4","5", file=f, end="!", sep=",")
334+
print(1,2,3,sep=",", flush=False, end=",\n", file=f)
335+
print("4",5, file=f, end="!", flush=True, sep=",")
336336

337337
with open("testfile", "r") as f:
338338
assert f.read() == "1,2,3,\n4,5!"

0 commit comments

Comments
 (0)