diff options
Diffstat (limited to 'Lib/test/test_normalization.py')
| -rw-r--r-- | Lib/test/test_normalization.py | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/Lib/test/test_normalization.py b/Lib/test/test_normalization.py index 30fa612..40d5894 100644 --- a/Lib/test/test_normalization.py +++ b/Lib/test/test_normalization.py @@ -37,15 +37,23 @@ def unistr(data): class NormalizationTest(unittest.TestCase): def test_main(self): - part = None - part1_data = {} # Hit the exception early try: testdata = open_urlresource(TESTDATAURL, encoding="utf-8", check=check_version) + except PermissionError: + self.skipTest("Permission error when downloading %s " + "into the test data directory" % TESTDATAURL) except (OSError, HTTPException): - self.skipTest("Could not retrieve " + TESTDATAURL) - self.addCleanup(testdata.close) + self.fail("Could not retrieve %s" % TESTDATAURL) + + with testdata: + self.run_normalization_tests(testdata) + + def run_normalization_tests(self, testdata): + part = None + part1_data = {} + for line in testdata: if '#' in line: line = line.split('#')[0] |
