diff options
-rw-r--r-- | Lib/test/test_normalization.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Lib/test/test_normalization.py b/Lib/test/test_normalization.py index 94d65b8..6641554 100644 --- a/Lib/test/test_normalization.py +++ b/Lib/test/test_normalization.py @@ -42,6 +42,11 @@ def unistr(data): class NormalizationTest(unittest.TestCase): def test_main(self): part1_data = {} + # Hit the exception early + try: + open_urlresource(TESTDATAURL, encoding="utf-8") + except IOError: + self.skipTest("Could not retrieve " + TESTDATAURL) for line in open_urlresource(TESTDATAURL, encoding="utf-8"): if '#' in line: line = line.split('#')[0] @@ -97,8 +102,6 @@ class NormalizationTest(unittest.TestCase): def test_main(): - # Skip the test early if the 'urlfetch' resource is not enabled. - open_urlresource(TESTDATAURL) run_unittest(NormalizationTest) if __name__ == "__main__": |