add test for conversion to string

--HG--
branch : trunk
This commit is contained in:
Benjamin Peterson 2009-08-30 08:25:48 -05:00
parent 749bfa46c4
commit e336683cdb
1 changed files with 6 additions and 0 deletions

View File

@ -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")