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

Delta Between Two Patch Sets: Lib/test/test_epoll.py

Issue 16510: Using appropriate checks in tests
Left Patch Set: Created 5 years, 9 months ago
Right Patch Set: Created 5 years, 6 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:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « Lib/test/test_dbm.py ('k') | Lib/test/test_faulthandler.py » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 # Copyright (c) 2001-2006 Twisted Matrix Laboratories. 1 # Copyright (c) 2001-2006 Twisted Matrix Laboratories.
2 # 2 #
3 # Permission is hereby granted, free of charge, to any person obtaining 3 # Permission is hereby granted, free of charge, to any person obtaining
4 # a copy of this software and associated documentation files (the 4 # a copy of this software and associated documentation files (the
5 # "Software"), to deal in the Software without restriction, including 5 # "Software"), to deal in the Software without restriction, including
6 # without limitation the rights to use, copy, modify, merge, publish, 6 # without limitation the rights to use, copy, modify, merge, publish,
7 # distribute, sublicense, and/or sell copies of the Software, and to 7 # distribute, sublicense, and/or sell copies of the Software, and to
8 # permit persons to whom the Software is furnished to do so, subject to 8 # permit persons to whom the Software is furnished to do so, subject to
9 # the following conditions: 9 # the following conditions:
10 # 10 #
(...skipping 29 matching lines...) Expand all
40 raise 40 raise
41 41
42 class TestEPoll(unittest.TestCase): 42 class TestEPoll(unittest.TestCase):
43 43
44 def setUp(self): 44 def setUp(self):
45 self.serverSocket = socket.socket() 45 self.serverSocket = socket.socket()
46 self.serverSocket.bind(('127.0.0.1', 0)) 46 self.serverSocket.bind(('127.0.0.1', 0))
47 self.serverSocket.listen(1) 47 self.serverSocket.listen(1)
48 self.connections = [self.serverSocket] 48 self.connections = [self.serverSocket]
49 49
50
51 def tearDown(self): 50 def tearDown(self):
52 for skt in self.connections: 51 for skt in self.connections:
53 skt.close() 52 skt.close()
54 53
55 def _connected_pair(self): 54 def _connected_pair(self):
56 client = socket.socket() 55 client = socket.socket()
57 client.setblocking(False) 56 client.setblocking(False)
58 try: 57 try:
59 client.connect(('127.0.0.1', self.serverSocket.getsockname()[1])) 58 client.connect(('127.0.0.1', self.serverSocket.getsockname()[1]))
60 except OSError as e: 59 except OSError as e:
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 epoll = select.epoll() 253 epoll = select.epoll()
255 self.addCleanup(epoll.close) 254 self.addCleanup(epoll.close)
256 self.assertEqual(os.get_inheritable(epoll.fileno()), False) 255 self.assertEqual(os.get_inheritable(epoll.fileno()), False)
257 256
258 257
259 def test_main(): 258 def test_main():
260 support.run_unittest(TestEPoll) 259 support.run_unittest(TestEPoll)
261 260
262 if __name__ == "__main__": 261 if __name__ == "__main__":
263 test_main() 262 test_main()
LEFTRIGHT

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