[Python-checkins] r76535 - in python/trunk/Lib/test: test_multibytecodec_support.py test_normalization.py

antoine.pitrou python-checkins at python.org
Thu Nov 26 13:36:30 CET 2009


Author: antoine.pitrou
Date: Thu Nov 26 13:36:30 2009
New Revision: 76535

Log:
When open_urlresource() fails, HTTPException is another possible error



Modified:
   python/trunk/Lib/test/test_multibytecodec_support.py
   python/trunk/Lib/test/test_normalization.py

Modified: python/trunk/Lib/test/test_multibytecodec_support.py
==============================================================================
--- python/trunk/Lib/test/test_multibytecodec_support.py	(original)
+++ python/trunk/Lib/test/test_multibytecodec_support.py	Thu Nov 26 13:36:30 2009
@@ -6,6 +6,7 @@
 
 import sys, codecs
 import unittest, re
+from httplib import HTTPException
 from test import test_support
 from StringIO import StringIO
 
@@ -268,7 +269,7 @@
         unittest.TestCase.__init__(self, *args, **kw)
         try:
             self.open_mapping_file() # test it to report the error early
-        except IOError:
+        except (IOError, HTTPException):
             self.skipTest("Could not retrieve "+self.mapfileurl)
 
     def open_mapping_file(self):

Modified: python/trunk/Lib/test/test_normalization.py
==============================================================================
--- python/trunk/Lib/test/test_normalization.py	(original)
+++ python/trunk/Lib/test/test_normalization.py	Thu Nov 26 13:36:30 2009
@@ -1,6 +1,7 @@
 from test.test_support import run_unittest, open_urlresource
 import unittest
 
+from httplib import HTTPException
 import sys
 import os
 from unicodedata import normalize, unidata_version
@@ -43,7 +44,7 @@
         # Hit the exception early
         try:
             open_urlresource(TESTDATAURL)
-        except IOError:
+        except (IOError, HTTPException):
             self.skipTest("Could not retrieve " + TESTDATAURL)
         for line in open_urlresource(TESTDATAURL):
             if '#' in line:


More information about the Python-checkins mailing list