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

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

Issue 10639: reindent.py converts newlines to platform default
Patch Set: Created 8 years, 8 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_unicode.py ('k') | Lib/test/test_urllib2.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 #!/usr/bin/env python3 1 #!/usr/bin/env python3
2 2
3 import unittest 3 import unittest
4 from test import support 4 from test import support
5 from test.test_urllib2 import sanepathname2url 5 from test.test_urllib2 import sanepathname2url
6 6
7 import os 7 import os
8 import socket 8 import socket
9 import urllib.error 9 import urllib.error
10 import urllib.request 10 import urllib.request
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 except socket.timeout: 215 except socket.timeout:
216 print("<timeout: %s>" % url, file=sys.stderr) 216 print("<timeout: %s>" % url, file=sys.stderr)
217 f.close() 217 f.close()
218 debug("******** next url coming up...") 218 debug("******** next url coming up...")
219 time.sleep(0.1) 219 time.sleep(0.1)
220 220
221 def _extra_handlers(self): 221 def _extra_handlers(self):
222 handlers = [] 222 handlers = []
223 223
224 cfh = urllib.request.CacheFTPHandler() 224 cfh = urllib.request.CacheFTPHandler()
225 self.addCleanup(cfh.clear_cache)
226 cfh.setTimeout(1) 225 cfh.setTimeout(1)
227 handlers.append(cfh) 226 handlers.append(cfh)
228 227
229 return handlers 228 return handlers
230 229
231 230
232 class TimeoutTest(unittest.TestCase): 231 class TimeoutTest(unittest.TestCase):
233 def test_http_basic(self): 232 def test_http_basic(self):
234 self.assertTrue(socket.getdefaulttimeout() is None) 233 self.assertTrue(socket.getdefaulttimeout() is None)
235 url = "http://www.python.org" 234 url = "http://www.python.org"
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 support.requires("network") 331 support.requires("network")
333 support.run_unittest(AuthTests, 332 support.run_unittest(AuthTests,
334 HTTPSTests, 333 HTTPSTests,
335 OtherNetworkTests, 334 OtherNetworkTests,
336 CloseSocketTest, 335 CloseSocketTest,
337 TimeoutTest, 336 TimeoutTest,
338 ) 337 )
339 338
340 if __name__ == "__main__": 339 if __name__ == "__main__":
341 test_main() 340 test_main()
OLDNEW
« no previous file with comments | « Lib/test/test_unicode.py ('k') | Lib/test/test_urllib2.py » ('j') | no next file with comments »

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