From 9de0b4d8b86ac91f61b4e091ed8dd4777a5d805f Mon Sep 17 00:00:00 2001 From: "antoine.pitrou" Date: Sun, 1 Nov 2009 21:26:14 +0000 Subject: [PATCH] test_normalization should skip and not crash when the resource isn't available git-svn-id: http://svn.python.org/projects/python/trunk@76033 6015fed2-1504-0410-9fe1-9d1591cc4771 --- Lib/test/test_normalization.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Lib/test/test_normalization.py b/Lib/test/test_normalization.py index 0eea4bfc4e..6a7574143f 100644 --- a/Lib/test/test_normalization.py +++ b/Lib/test/test_normalization.py @@ -40,6 +40,11 @@ def unistr(data): 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 @@ class NormalizationTest(unittest.TestCase): def test_main(): - # Hit the exception early - open_urlresource(TESTDATAURL) run_unittest(NormalizationTest) if __name__ == "__main__": -- 2.11.4.GIT