From 1a689189d272bf995bdcb8cfae6188bee08ccb7e Mon Sep 17 00:00:00 2001 From: Antoine Pitrou Date: Fri, 13 Jul 2012 20:54:42 +0200 Subject: [PATCH] Issue #15338: skip test_UNC_path when the current user doesn't have enough permissions to access the path. --- Lib/test/test_import.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Lib/test/test_import.py b/Lib/test/test_import.py index 1612a471858..2f46d8342b0 100644 --- a/Lib/test/test_import.py +++ b/Lib/test/test_import.py @@ -427,6 +427,13 @@ class PathsTests(unittest.TestCase): drive = path[0] unc = "\\\\%s\\%s$"%(hn, drive) unc += path[2:] + try: + os.listdir(unc) + except OSError as e: + if e.errno in (errno.EPERM, errno.EACCES): + # See issue #15338 + self.skipTest("cannot access administrative share %r" % (unc,)) + raise sys.path.append(path) mod = __import__("test_trailing_slash") self.assertEqual(mod.testdata, 'test_trailing_slash')