Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(45)

Side by Side Diff: Lib/test/test_kqueue.py

Issue 16510: Using appropriate checks in tests
Patch Set: Created 6 years, 5 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Lib/test/test_itertools.py ('k') | Lib/test/test_list.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 """ 1 """
2 Tests for kqueue wrapper. 2 Tests for kqueue wrapper.
3 """ 3 """
4 import errno 4 import errno
5 import os 5 import os
6 import select 6 import select
7 import socket 7 import socket
8 import sys 8 import sys
9 import time 9 import time
10 import unittest 10 import unittest
11 11
12 from test import support 12 from test import support
13 if not hasattr(select, "kqueue"): 13 if not hasattr(select, "kqueue"):
14 raise unittest.SkipTest("test works only on BSD") 14 raise unittest.SkipTest("test works only on BSD")
15 15
16 class TestKQueue(unittest.TestCase): 16 class TestKQueue(unittest.TestCase):
17 def test_create_queue(self): 17 def test_create_queue(self):
18 kq = select.kqueue() 18 kq = select.kqueue()
19 self.assertTrue(kq.fileno() > 0, kq.fileno()) 19 self.assertTrue(kq.fileno() > 0, kq.fileno())
20 self.assertTrue(not kq.closed) 20 self.assertFalse(kq.closed)
21 kq.close() 21 kq.close()
22 self.assertTrue(kq.closed) 22 self.assertTrue(kq.closed)
23 self.assertRaises(ValueError, kq.fileno) 23 self.assertRaises(ValueError, kq.fileno)
24 24
25 def test_create_event(self): 25 def test_create_event(self):
26 from operator import lt, le, gt, ge 26 from operator import lt, le, gt, ge
27 27
28 fd = os.open(os.devnull, os.O_WRONLY) 28 fd = os.open(os.devnull, os.O_WRONLY)
29 self.addCleanup(os.close, fd) 29 self.addCleanup(os.close, fd)
30 30
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 192
193 a.close() 193 a.close()
194 b.close() 194 b.close()
195 kq.close() 195 kq.close()
196 196
197 def test_main(): 197 def test_main():
198 support.run_unittest(TestKQueue) 198 support.run_unittest(TestKQueue)
199 199
200 if __name__ == "__main__": 200 if __name__ == "__main__":
201 test_main() 201 test_main()
OLDNEW
« no previous file with comments | « Lib/test/test_itertools.py ('k') | Lib/test/test_list.py » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+