diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2009-11-01 21:43:20 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2009-11-01 21:43:20 (GMT) |
commit | 7e05e7d3b64b3874b8086e607601edd0f46666bd (patch) | |
tree | 9872f334db9062bb364f82b751741961f69189cf /Lib/test/test_normalization.py | |
parent | e0450c6aae1444609fc3b17a233d69312744024f (diff) | |
download | cpython-7e05e7d3b64b3874b8086e607601edd0f46666bd.zip cpython-7e05e7d3b64b3874b8086e607601edd0f46666bd.tar.gz cpython-7e05e7d3b64b3874b8086e607601edd0f46666bd.tar.bz2 |
Merged revisions 76033 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r76033 | antoine.pitrou | 2009-11-01 22:26:14 +0100 (dim., 01 nov. 2009) | 3 lines
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 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__": |