[Python-checkins] r76033 - python/trunk/Lib/test/test_normalization.py

antoine.pitrou python-checkins at python.org
Sun Nov 1 22:26:14 CET 2009


Author: antoine.pitrou
Date: Sun Nov  1 22:26:14 2009
New Revision: 76033

Log:
test_normalization should skip and not crash when the resource isn't available



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

Modified: python/trunk/Lib/test/test_normalization.py
==============================================================================
--- python/trunk/Lib/test/test_normalization.py	(original)
+++ python/trunk/Lib/test/test_normalization.py	Sun Nov  1 22:26:14 2009
@@ -40,6 +40,11 @@
 class NormalizationTest(unittest.TestCase):
     def test_main(self):
         part1_data = {}
+        # Hit the exception early
+        try:
+            open_urlresource(TESTDATAURL)
+        except IOError:
+            self.skipTest("Could not retrieve " + TESTDATAURL)
         for line in open_urlresource(TESTDATAURL):
             if '#' in line:
                 line = line.split('#')[0]
@@ -95,8 +100,6 @@
 
 
 def test_main():
-    # Hit the exception early
-    open_urlresource(TESTDATAURL)
     run_unittest(NormalizationTest)
 
 if __name__ == "__main__":


More information about the Python-checkins mailing list