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

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

Issue 16510: Using appropriate checks in tests
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:
View unified diff | Download patch
« no previous file with comments | « Lib/test/test_ast.py ('k') | Lib/test/test_augassign.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 import asyncore 1 import asyncore
2 import unittest 2 import unittest
3 import select 3 import select
4 import os 4 import os
5 import socket 5 import socket
6 import sys 6 import sys
7 import time 7 import time
8 import warnings 8 import warnings
9 import errno 9 import errno
10 import struct 10 import struct
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 self.assertEqual(family, socket.AF_INET) 332 self.assertEqual(family, socket.AF_INET)
333 self.assertEqual(len(w), 1) 333 self.assertEqual(len(w), 1)
334 self.assertTrue(issubclass(w[0].category, DeprecationWarning)) 334 self.assertTrue(issubclass(w[0].category, DeprecationWarning))
335 335
336 def test_strerror(self): 336 def test_strerror(self):
337 # refers to bug #8573 337 # refers to bug #8573
338 err = asyncore._strerror(errno.EPERM) 338 err = asyncore._strerror(errno.EPERM)
339 if hasattr(os, 'strerror'): 339 if hasattr(os, 'strerror'):
340 self.assertEqual(err, os.strerror(errno.EPERM)) 340 self.assertEqual(err, os.strerror(errno.EPERM))
341 err = asyncore._strerror(-1) 341 err = asyncore._strerror(-1)
342 self.assertTrue(err != "") 342 self.assertNotEqual(err, "")
343 343
344 344
345 class dispatcherwithsend_noread(asyncore.dispatcher_with_send): 345 class dispatcherwithsend_noread(asyncore.dispatcher_with_send):
346 def readable(self): 346 def readable(self):
347 return False 347 return False
348 348
349 def handle_connect(self): 349 def handle_connect(self):
350 pass 350 pass
351 351
352 class DispatcherWithSendTests(unittest.TestCase): 352 class DispatcherWithSendTests(unittest.TestCase):
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after
848 848
849 class TestAPI_UseUnixSocketsSelect(TestAPI_UseUnixSockets, unittest.TestCase): 849 class TestAPI_UseUnixSocketsSelect(TestAPI_UseUnixSockets, unittest.TestCase):
850 use_poll = False 850 use_poll = False
851 851
852 @unittest.skipUnless(hasattr(select, 'poll'), 'select.poll required') 852 @unittest.skipUnless(hasattr(select, 'poll'), 'select.poll required')
853 class TestAPI_UseUnixSocketsPoll(TestAPI_UseUnixSockets, unittest.TestCase): 853 class TestAPI_UseUnixSocketsPoll(TestAPI_UseUnixSockets, unittest.TestCase):
854 use_poll = True 854 use_poll = True
855 855
856 if __name__ == "__main__": 856 if __name__ == "__main__":
857 unittest.main() 857 unittest.main()
OLDNEW
« no previous file with comments | « Lib/test/test_ast.py ('k') | Lib/test/test_augassign.py » ('j') | no next file with comments »

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