From 4cce44ab31d10e2dd5fc2d96d65ecc5e092f7bf7 Mon Sep 17 00:00:00 2001 From: "Y. Sapir" Date: Fri, 3 May 2019 02:24:55 +0300 Subject: [PATCH] Add test for print file parameter --- tests/snippets/printing.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/snippets/printing.py b/tests/snippets/printing.py index e420c6c7f..b2c9ca55d 100644 --- a/tests/snippets/printing.py +++ b/tests/snippets/printing.py @@ -1,4 +1,5 @@ from testutils import assert_raises +import io print(2 + 3) @@ -9,3 +10,7 @@ try: print('test', end=None, sep=None, flush=None) except: assert False, 'Expected None passed to end, sep, and flush to not raise errors' + +buf = io.StringIO() +print('hello, world', file=buf) +assert buf.getvalue() == 'hello, world\n', buf.getvalue()