Skip to content

Commit

Permalink
gh-99892: test_unicodedata: skip test on download failure (GH-100011)
Browse files Browse the repository at this point in the history
Skip test_normalization() of test_unicodedata if it fails to download
NormalizationTest.txt file from pythontest.net.
(cherry picked from commit 2488c1e)

Co-authored-by: Victor Stinner <vstinner@python.org>
  • Loading branch information
miss-islington and vstinner committed Dec 5, 2022
1 parent 5533cf6 commit 4a7612f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Lib/test/test_unicodedata.py
Expand Up @@ -12,7 +12,8 @@
import unicodedata
import unittest
from test.support import (open_urlresource, requires_resource, script_helper,
cpython_only, check_disallow_instantiation)
cpython_only, check_disallow_instantiation,
ResourceDenied)


class UnicodeMethodsTest(unittest.TestCase):
Expand Down Expand Up @@ -345,8 +346,8 @@ def test_normalization(self):
except PermissionError:
self.skipTest(f"Permission error when downloading {TESTDATAURL} "
f"into the test data directory")
except (OSError, HTTPException):
self.fail(f"Could not retrieve {TESTDATAURL}")
except (OSError, HTTPException) as exc:
self.skipTest(f"Failed to download {TESTDATAURL}: {exc}")

with testdata:
self.run_normalization_tests(testdata)
Expand Down
@@ -0,0 +1,2 @@
Skip test_normalization() of test_unicodedata if it fails to download
NormalizationTest.txt file from pythontest.net. Patch by Victor Stinner.

0 comments on commit 4a7612f

Please sign in to comment.