1 from test_support
import verbose
7 def readlines(self
, sizehint
= None):
8 self
.count
= self
.count
- 1
9 return map(lambda x
: "%d\n" % x
, range(self
.count
))
19 xreadlines
.xreadlines(Null())[0]
20 except AttributeError, detail
:
21 print "AttributeError (expected)"
23 print "Did not throw attribute error"
26 xreadlines
.xreadlines(XReader
)[0]
27 except TypeError, detail
:
28 print "TypeError (expected)"
30 print "Did not throw type error"
33 xreadlines
.xreadlines(XReader())[1]
34 except RuntimeError, detail
:
35 print "RuntimeError (expected):", detail
37 print "Did not throw runtime error"
39 xresult
= ['0\n', '1\n', '2\n', '3\n', '0\n', '1\n', '2\n', '0\n', '1\n', '0\n']
40 for line
in xreadlines
.xreadlines(XReader()):
41 if line
!= xresult
[lineno
]:
42 print "line %d differs" % lineno