1 # Testing select module
2 from test_support
import verbose
6 # test some known error conditions
8 rfd
, wfd
, xfd
= select
.select(1, 2, 3)
12 print 'expected TypeError exception not raised'
22 rfd
, wfd
, xfd
= select
.select([Nope()], [], [])
26 print 'expected TypeError exception not raised'
29 rfd
, wfd
, xfd
= select
.select([Almost()], [], [])
33 print 'expected TypeError exception not raised'
38 if sys
.platform
[:3] in ('win', 'mac', 'os2'):
40 print "Can't test select easily on", sys
.platform
42 cmd
= 'for i in 0 1 2 3 4 5 6 7 8 9; do echo testing...; sleep 1; done'
43 p
= os
.popen(cmd
, 'r')
44 for tout
in (0, 1, 2, 4, 8, 16) + (None,)*10:
46 print 'timeout =', tout
47 rfd
, wfd
, xfd
= select
.select([p
], [], [], tout
)
48 ## print rfd, wfd, xfd
49 if (rfd
, wfd
, xfd
) == ([], [], []):
51 if (rfd
, wfd
, xfd
) == ([p
], [], []):