annotate Lib/test/test_poll.py @ 79675:c0a2294de787 2.7

Issue #16199: Backport 2to3 typo fix from 3.2.
author Chris Jerdonek <chris.jerdonek@gmail.com>
date Thu, 11 Oct 2012 16:15:46 -0700
parents 228cfb6e2900
children d544873d62e9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
14175
8d1a059ae99d Test suite for poll() interface (SF patch #100852)
Andrew M. Kuchling <amk@amk.ca>
parents:
diff changeset
1 # Test case for the os.poll() function
15305
07f24261c6e6 Make reindent.py happy (convert everything to 4-space indents!).
Fred Drake <fdrake@acm.org>
parents: 14247
diff changeset
2
45468
1d84bf5f9478 Patch #2167 from calvin: Remove unused imports
Christian Heimes <christian@cheimes.de>
parents: 40284
diff changeset
3 import os, select, random, unittest
52355
228cfb6e2900 fix incorrect auto-translation of TestSkipped -> unittest.SkipTest
Benjamin Peterson <benjamin@python.org>
parents: 52353
diff changeset
4 from test.test_support import TESTFN, run_unittest
14175
8d1a059ae99d Test suite for poll() interface (SF patch #100852)
Andrew M. Kuchling <amk@amk.ca>
parents:
diff changeset
5
8d1a059ae99d Test suite for poll() interface (SF patch #100852)
Andrew M. Kuchling <amk@amk.ca>
parents:
diff changeset
6 try:
8d1a059ae99d Test suite for poll() interface (SF patch #100852)
Andrew M. Kuchling <amk@amk.ca>
parents:
diff changeset
7 select.poll
8d1a059ae99d Test suite for poll() interface (SF patch #100852)
Andrew M. Kuchling <amk@amk.ca>
parents:
diff changeset
8 except AttributeError:
52355
228cfb6e2900 fix incorrect auto-translation of TestSkipped -> unittest.SkipTest
Benjamin Peterson <benjamin@python.org>
parents: 52353
diff changeset
9 raise unittest.SkipTest, "select.poll not defined -- skipping test_poll"
14175
8d1a059ae99d Test suite for poll() interface (SF patch #100852)
Andrew M. Kuchling <amk@amk.ca>
parents:
diff changeset
10
8d1a059ae99d Test suite for poll() interface (SF patch #100852)
Andrew M. Kuchling <amk@amk.ca>
parents:
diff changeset
11
8d1a059ae99d Test suite for poll() interface (SF patch #100852)
Andrew M. Kuchling <amk@amk.ca>
parents:
diff changeset
12 def find_ready_matching(ready, flag):
8d1a059ae99d Test suite for poll() interface (SF patch #100852)
Andrew M. Kuchling <amk@amk.ca>
parents:
diff changeset
13 match = []
8d1a059ae99d Test suite for poll() interface (SF patch #100852)
Andrew M. Kuchling <amk@amk.ca>
parents:
diff changeset
14 for fd, mode in ready:
8d1a059ae99d Test suite for poll() interface (SF patch #100852)
Andrew M. Kuchling <amk@amk.ca>
parents:
diff changeset
15 if mode & flag:
8d1a059ae99d Test suite for poll() interface (SF patch #100852)
Andrew M. Kuchling <amk@amk.ca>
parents:
diff changeset
16 match.append(fd)
8d1a059ae99d Test suite for poll() interface (SF patch #100852)
Andrew M. Kuchling <amk@amk.ca>
parents:
diff changeset
17 return match
8d1a059ae99d Test suite for poll() interface (SF patch #100852)
Andrew M. Kuchling <amk@amk.ca>
parents:
diff changeset
18
40260
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
19 class PollTests(unittest.TestCase):
14175
8d1a059ae99d Test suite for poll() interface (SF patch #100852)
Andrew M. Kuchling <amk@amk.ca>
parents:
diff changeset
20
40260
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
21 def test_poll1(self):
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
22 # Basic functional test of poll object
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
23 # Create a bunch of pipe and test that poll works with them.
40284
ff678669aa6e Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents: 40260
diff changeset
24
40260
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
25 p = select.poll()
14175
8d1a059ae99d Test suite for poll() interface (SF patch #100852)
Andrew M. Kuchling <amk@amk.ca>
parents:
diff changeset
26
40260
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
27 NUM_PIPES = 12
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
28 MSG = " This is a test."
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
29 MSG_LEN = len(MSG)
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
30 readers = []
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
31 writers = []
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
32 r2w = {}
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
33 w2r = {}
14175
8d1a059ae99d Test suite for poll() interface (SF patch #100852)
Andrew M. Kuchling <amk@amk.ca>
parents:
diff changeset
34
40260
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
35 for i in range(NUM_PIPES):
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
36 rd, wr = os.pipe()
45991
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 45468
diff changeset
37 p.register(rd)
728dc13327b2 Applied patch #1657 epoll and kqueue wrappers for the select module
Christian Heimes <christian@cheimes.de>
parents: 45468
diff changeset
38 p.modify(rd, select.POLLIN)
40260
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
39 p.register(wr, select.POLLOUT)
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
40 readers.append(rd)
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
41 writers.append(wr)
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
42 r2w[rd] = wr
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
43 w2r[wr] = rd
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
44
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
45 bufs = []
14175
8d1a059ae99d Test suite for poll() interface (SF patch #100852)
Andrew M. Kuchling <amk@amk.ca>
parents:
diff changeset
46
40260
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
47 while writers:
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
48 ready = p.poll()
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
49 ready_writers = find_ready_matching(ready, select.POLLOUT)
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
50 if not ready_writers:
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
51 raise RuntimeError, "no pipes ready for writing"
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
52 wr = random.choice(ready_writers)
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
53 os.write(wr, MSG)
14175
8d1a059ae99d Test suite for poll() interface (SF patch #100852)
Andrew M. Kuchling <amk@amk.ca>
parents:
diff changeset
54
40260
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
55 ready = p.poll()
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
56 ready_readers = find_ready_matching(ready, select.POLLIN)
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
57 if not ready_readers:
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
58 raise RuntimeError, "no pipes ready for reading"
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
59 rd = random.choice(ready_readers)
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
60 buf = os.read(rd, MSG_LEN)
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
61 self.assertEqual(len(buf), MSG_LEN)
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
62 bufs.append(buf)
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
63 os.close(r2w[rd]) ; os.close( rd )
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
64 p.unregister( r2w[rd] )
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
65 p.unregister( rd )
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
66 writers.remove(r2w[rd])
14175
8d1a059ae99d Test suite for poll() interface (SF patch #100852)
Andrew M. Kuchling <amk@amk.ca>
parents:
diff changeset
67
40260
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
68 self.assertEqual(bufs, [MSG] * NUM_PIPES)
14175
8d1a059ae99d Test suite for poll() interface (SF patch #100852)
Andrew M. Kuchling <amk@amk.ca>
parents:
diff changeset
69
40260
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
70 def poll_unit_tests(self):
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
71 # returns NVAL for invalid file descriptor
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
72 FD = 42
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
73 try:
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
74 os.close(FD)
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
75 except OSError:
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
76 pass
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
77 p = select.poll()
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
78 p.register(FD)
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
79 r = p.poll()
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
80 self.assertEqual(r[0], (FD, select.POLLNVAL))
14175
8d1a059ae99d Test suite for poll() interface (SF patch #100852)
Andrew M. Kuchling <amk@amk.ca>
parents:
diff changeset
81
40260
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
82 f = open(TESTFN, 'w')
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
83 fd = f.fileno()
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
84 p = select.poll()
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
85 p.register(f)
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
86 r = p.poll()
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
87 self.assertEqual(r[0][0], fd)
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
88 f.close()
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
89 r = p.poll()
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
90 self.assertEqual(r[0], (fd, select.POLLNVAL))
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
91 os.unlink(TESTFN)
14175
8d1a059ae99d Test suite for poll() interface (SF patch #100852)
Andrew M. Kuchling <amk@amk.ca>
parents:
diff changeset
92
40260
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
93 # type error for invalid arguments
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
94 p = select.poll()
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
95 self.assertRaises(TypeError, p.register, p)
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
96 self.assertRaises(TypeError, p.unregister, p)
14175
8d1a059ae99d Test suite for poll() interface (SF patch #100852)
Andrew M. Kuchling <amk@amk.ca>
parents:
diff changeset
97
40260
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
98 # can't unregister non-existent object
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
99 p = select.poll()
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
100 self.assertRaises(KeyError, p.unregister, 3)
14175
8d1a059ae99d Test suite for poll() interface (SF patch #100852)
Andrew M. Kuchling <amk@amk.ca>
parents:
diff changeset
101
40260
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
102 # Test error cases
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
103 pollster = select.poll()
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
104 class Nope:
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
105 pass
14175
8d1a059ae99d Test suite for poll() interface (SF patch #100852)
Andrew M. Kuchling <amk@amk.ca>
parents:
diff changeset
106
40260
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
107 class Almost:
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
108 def fileno(self):
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
109 return 'fileno'
14175
8d1a059ae99d Test suite for poll() interface (SF patch #100852)
Andrew M. Kuchling <amk@amk.ca>
parents:
diff changeset
110
40260
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
111 self.assertRaises(TypeError, pollster.register, Nope(), 0)
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
112 self.assertRaises(TypeError, pollster.register, Almost(), 0)
14175
8d1a059ae99d Test suite for poll() interface (SF patch #100852)
Andrew M. Kuchling <amk@amk.ca>
parents:
diff changeset
113
40260
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
114 # Another test case for poll(). This is copied from the test case for
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
115 # select(), modified to use poll() instead.
14175
8d1a059ae99d Test suite for poll() interface (SF patch #100852)
Andrew M. Kuchling <amk@amk.ca>
parents:
diff changeset
116
40260
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
117 def test_poll2(self):
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
118 cmd = 'for i in 0 1 2 3 4 5 6 7 8 9; do echo testing...; sleep 1; done'
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
119 p = os.popen(cmd, 'r')
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
120 pollster = select.poll()
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
121 pollster.register( p, select.POLLIN )
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
122 for tout in (0, 1000, 2000, 4000, 8000, 16000) + (-1,)*10:
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
123 fdlist = pollster.poll(tout)
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
124 if (fdlist == []):
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
125 continue
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
126 fd, flags = fdlist[0]
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
127 if flags & select.POLLHUP:
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
128 line = p.readline()
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
129 if line != "":
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
130 self.fail('error: pipe seems to be closed, but still returns data')
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
131 continue
14175
8d1a059ae99d Test suite for poll() interface (SF patch #100852)
Andrew M. Kuchling <amk@amk.ca>
parents:
diff changeset
132
40260
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
133 elif flags & select.POLLIN:
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
134 line = p.readline()
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
135 if not line:
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
136 break
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
137 continue
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
138 else:
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
139 self.fail('Unexpected return value from select.poll: %s' % fdlist)
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
140 p.close()
14175
8d1a059ae99d Test suite for poll() interface (SF patch #100852)
Andrew M. Kuchling <amk@amk.ca>
parents:
diff changeset
141
40260
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
142 def test_poll3(self):
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
143 # test int overflow
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
144 pollster = select.poll()
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
145 pollster.register(1)
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
146
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
147 self.assertRaises(OverflowError, pollster.poll, 1L << 64)
35834
418a61ead11b Bug #1346533, select.poll() doesn't raise an error if timeout > sys.maxint
Neal Norwitz <nnorwitz@gmail.com>
parents: 31515
diff changeset
148
40260
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
149 x = 2 + 3
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
150 if x != 5:
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
151 self.fail('Overflow must have occurred')
35834
418a61ead11b Bug #1346533, select.poll() doesn't raise an error if timeout > sys.maxint
Neal Norwitz <nnorwitz@gmail.com>
parents: 31515
diff changeset
152
40260
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
153 def test_main():
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
154 run_unittest(PollTests)
36121
686306a67e9b Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents: 35834
diff changeset
155
40260
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
156 if __name__ == '__main__':
f56b25168142 Convert test_poll to unittest.
Georg Brandl <georg@python.org>
parents: 36121
diff changeset
157 test_main()