summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2017-04-20 00:39:59 (GMT)
committerGitHub <noreply@github.com>2017-04-20 00:39:59 (GMT)
commitd13d54748d3a7db023d9db37223ea7d40bb8f8e3 (patch)
tree2616b711afdd8da9cdc0f1f194a77909a2888220
parentec4b17239d899550be4ee6104b61751bb3c70382 (diff)
downloadcpython-d13d54748d3a7db023d9db37223ea7d40bb8f8e3.zip
cpython-d13d54748d3a7db023d9db37223ea7d40bb8f8e3.tar.gz
cpython-d13d54748d3a7db023d9db37223ea7d40bb8f8e3.tar.bz2
bpo-29887: test_normalization handles PermissionError (#1196)
Skip test_normalization.test_main() if download raises a permission error.
-rw-r--r--Lib/test/test_normalization.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/test/test_normalization.py b/Lib/test/test_normalization.py
index c6f8c93..3042456 100644
--- a/Lib/test/test_normalization.py
+++ b/Lib/test/test_normalization.py
@@ -40,6 +40,9 @@ class NormalizationTest(unittest.TestCase):
try:
testdata = open_urlresource(TESTDATAURL, encoding="utf-8",
check=check_version)
+ 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}")