Skip to content

Commit 2488c1e

Browse files
authored
gh-99892: test_unicodedata: skip test on download failure (#100011)
Skip test_normalization() of test_unicodedata if it fails to download NormalizationTest.txt file from pythontest.net.
1 parent 5ea052b commit 2488c1e

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

Lib/test/test_unicodedata.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
import unicodedata
1313
import unittest
1414
from test.support import (open_urlresource, requires_resource, script_helper,
15-
cpython_only, check_disallow_instantiation)
15+
cpython_only, check_disallow_instantiation,
16+
ResourceDenied)
1617

1718

1819
class UnicodeMethodsTest(unittest.TestCase):
@@ -364,8 +365,8 @@ def test_normalization(self):
364365
except PermissionError:
365366
self.skipTest(f"Permission error when downloading {TESTDATAURL} "
366367
f"into the test data directory")
367-
except (OSError, HTTPException):
368-
self.fail(f"Could not retrieve {TESTDATAURL}")
368+
except (OSError, HTTPException) as exc:
369+
self.skipTest(f"Failed to download {TESTDATAURL}: {exc}")
369370

370371
with testdata:
371372
self.run_normalization_tests(testdata)
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Skip test_normalization() of test_unicodedata if it fails to download
2+
NormalizationTest.txt file from pythontest.net. Patch by Victor Stinner.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy