summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_site.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2016-03-14 16:47:30 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2016-03-14 16:47:30 (GMT)
commit371977976595836b553969ad8b1630114f894062 (patch)
tree46897e9d7cfbc3116325e615b72c4da675ae7df6 /Lib/test/test_site.py
parentb3adb1adebc8090e8b838a7b921a4efef1adcf4c (diff)
parent21d0e1b5fcc5a02a90f2424028d64a551d224d74 (diff)
downloadcpython-371977976595836b553969ad8b1630114f894062.zip
cpython-371977976595836b553969ad8b1630114f894062.tar.gz
cpython-371977976595836b553969ad8b1630114f894062.tar.bz2
Merge 3.5 (test_site)
Diffstat (limited to 'Lib/test/test_site.py')
-rw-r--r--Lib/test/test_site.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/Lib/test/test_site.py b/Lib/test/test_site.py
index 574e496..21628a9 100644
--- a/Lib/test/test_site.py
+++ b/Lib/test/test_site.py
@@ -28,8 +28,13 @@ import site
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.