[Python-checkins] cpython (2.7): using test_support.transient_internet helper method in the urllib2net test.

senthil.kumaran python-checkins at python.org
Sun Jul 31 05:50:37 CEST 2011


http://hg.python.org/cpython/rev/abf6887b58c1
changeset:   71652:abf6887b58c1
branch:      2.7
parent:      71643:952e83a8bc78
user:        Senthil Kumaran <senthil at uthcode.com>
date:        Sun Jul 31 11:48:54 2011 +0800
summary:
  using test_support.transient_internet helper method in the urllib2net test.

files:
  Lib/test/test_urllib2net.py |  8 +++++---
  1 files changed, 5 insertions(+), 3 deletions(-)


diff --git a/Lib/test/test_urllib2net.py b/Lib/test/test_urllib2net.py
--- a/Lib/test/test_urllib2net.py
+++ b/Lib/test/test_urllib2net.py
@@ -190,9 +190,11 @@
         # Some sites do not send Connection: close header.
         # Verify that those work properly. (#issue12576)
 
-        req = urllib2.urlopen('http://www.imdb.com')
-        res = req.read()
-        self.assertTrue(res)
+        URL = 'http://www.imdb.com' # No Connection:close
+        with test_support.transient_internet(url):
+            req = urllib2.urlopen(URL)
+            res = req.read()
+            self.assertTrue(res)
 
     def _test_urls(self, urls, handlers, retry=True):
         import time

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list