cpython/Lib/test/test_softspace.py
Guido van Rossum be19ed77dd Fix most trivially-findable print statements.
There's one major and one minor category still unfixed:
doctests are the major category (and I hope to be able to augment the
refactoring tool to refactor bona fide doctests soon);
other code generating print statements in strings is the minor category.

(Oh, and I don't know if the compiler package works.)
2007-02-09 05:37:30 +00:00

14 lines
375 B
Python

from test import test_support
import StringIO
# SF bug 480215: softspace confused in nested print
f = StringIO.StringIO()
class C:
def __str__(self):
print('a', file=f)
return 'b'
print(C(), 'c ', 'd\t', 'e', file=f)
print('f', 'g', file=f)
# In 2.2 & earlier, this printed ' a\nbc d\te\nf g\n'
test_support.vereq(f.getvalue(), 'a\nb c d\te\nf g\n')