mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 18:59:04 +08:00
Add test for print file parameter
This commit is contained in:
1 parent
8f3b62ba0e
commit
4cce44ab31
1 file changed
+5
@@ -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()
|
||||
Reference in new issue
Block a user