diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2009-11-01 21:26:14 +0000 |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2009-11-01 21:26:14 +0000 |
commit | 5adfaf5a5105b507c28d1051e9e303b117c99ec7 (patch) | |
tree | aa5d14ef9bb5aaa2fc7eca085efe9fd86a0df241 /Lib/test/test_normalization.py | |
parent | 8c6d8e03b10ce6b3697413a8c1b28f4d64ff24da (diff) | |
download | cpython-5adfaf5a5105b507c28d1051e9e303b117c99ec7.tar.gz |
test_normalization should skip and not crash when the resource isn't available
Diffstat (limited to 'Lib/test/test_normalization.py')
-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 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__": |