mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 18:59:04 +08:00
18 lines
485 B
Python
18 lines
485 B
Python
import io
|
|
|
|
from testutils import assert_raises
|
|
|
|
print(2 + 3)
|
|
|
|
assert_raises(TypeError, print, "test", end=4, _msg="wrong type passed to end")
|
|
assert_raises(TypeError, print, "test", sep=["a"], _msg="wrong type passed to sep")
|
|
|
|
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()
|