[Python-checkins] cpython (merge 3.5 -> default): Merge 3.5 (test_site)

victor.stinner python-checkins at python.org
Mon Mar 14 13:09:18 EDT 2016


https://hg.python.org/cpython/rev/9caf236cbe6d
changeset: 100530:9caf236cbe6d
parent: 100528:d8d6ec1333e6
parent: 100529:0a583e60c406
user: Victor Stinner <victor.stinner at gmail.com>
date: Mon Mar 14 17:47:30 2016 +0100
summary:
 Merge 3.5 (test_site)
files:
 Lib/test/test_site.py | 9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/Lib/test/test_site.py b/Lib/test/test_site.py
--- a/Lib/test/test_site.py
+++ b/Lib/test/test_site.py
@@ -28,8 +28,13 @@
 
 if site.ENABLE_USER_SITE and not os.path.isdir(site.USER_SITE):
 # need to add user site directory for tests
- os.makedirs(site.USER_SITE)
- site.addsitedir(site.USER_SITE)
+ try:
+ os.makedirs(site.USER_SITE)
+ site.addsitedir(site.USER_SITE)
+ except PermissionError as exc:
+ raise unittest.SkipTest('unable to create user site directory (%r): %s'
+ % (site.USER_SITE, exc))
+
 
 class HelperFunctionsTests(unittest.TestCase):
 """Tests for helper functions.
-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /