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

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

Issue 16510: Using appropriate checks in tests
Patch Set: Created 6 years, 7 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 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 self.assertEqual(family, socket.AF_INET) 333 self.assertEqual(family, socket.AF_INET)
334 self.assertEqual(len(w), 1) 334 self.assertEqual(len(w), 1)
335 self.assertTrue(issubclass(w[0].category, DeprecationWarning)) 335 self.assertTrue(issubclass(w[0].category, DeprecationWarning))
336 336
337 def test_strerror(self): 337 def test_strerror(self):
338 # refers to bug #8573 338 # refers to bug #8573
339 err = asyncore._strerror(errno.EPERM) 339 err = asyncore._strerror(errno.EPERM)
340 if hasattr(os, 'strerror'): 340 if hasattr(os, 'strerror'):
341 self.assertEqual(err, os.strerror(errno.EPERM)) 341 self.assertEqual(err, os.strerror(errno.EPERM))
342 err = asyncore._strerror(-1) 342 err = asyncore._strerror(-1)
343 self.assertTrue(err != "") 343 self.assertNotEqual(err, "")
344 344
345 345
346 class dispatcherwithsend_noread(asyncore.dispatcher_with_send): 346 class dispatcherwithsend_noread(asyncore.dispatcher_with_send):
347 def readable(self): 347 def readable(self):
348 return False 348 return False
349 349
350 def handle_connect(self): 350 def handle_connect(self):
351 pass 351 pass
352 352
353 class DispatcherWithSendTests(unittest.TestCase): 353 class DispatcherWithSendTests(unittest.TestCase):
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after
837 837
838 class TestAPI_UseUnixSocketsSelect(TestAPI_UseUnixSockets, unittest.TestCase): 838 class TestAPI_UseUnixSocketsSelect(TestAPI_UseUnixSockets, unittest.TestCase):
839 use_poll = False 839 use_poll = False
840 840
841 @unittest.skipUnless(hasattr(select, 'poll'), 'select.poll required') 841 @unittest.skipUnless(hasattr(select, 'poll'), 'select.poll required')
842 class TestAPI_UseUnixSocketsPoll(TestAPI_UseUnixSockets, unittest.TestCase): 842 class TestAPI_UseUnixSocketsPoll(TestAPI_UseUnixSockets, unittest.TestCase):
843 use_poll = True 843 use_poll = True
844 844
845 if __name__ == "__main__": 845 if __name__ == "__main__":
846 unittest.main() 846 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+