From e336683cdbf81c8297e09e0c70450e3590286243 Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Sun, 30 Aug 2009 08:25:48 -0500 Subject: [PATCH] add test for conversion to string --HG-- branch : trunk --- py/builtin/testing/test_builtin.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/py/builtin/testing/test_builtin.py b/py/builtin/testing/test_builtin.py index ac8b6f7aa..fb4523e53 100644 --- a/py/builtin/testing/test_builtin.py +++ b/py/builtin/testing/test_builtin.py @@ -84,6 +84,12 @@ def test_print_simple(): s = f.getvalue() assert s == "xyzabc" + class X: + def __repr__(self): return "rep" + f = py.io.TextIO() + print_(X(), file=f) + assert f.getvalue() == "rep\n" + def test_execfile(tmpdir): test_file = tmpdir.join("test.py") test_file.write("x = y")