From: Antoine Pitrou Date: Fri, 13 Jul 2012 18:54:42 +0000 (+0200) Subject: Issue #15338: skip test_UNC_path when the current user doesn't have enough permission... X-Git-Tag: v3.3.0b2~225^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=68f4247b656148f7998cda856e3f77b0360a3c9c;p=thirdparty%2FPython%2Fcpython.git Issue #15338: skip test_UNC_path when the current user doesn't have enough permissions to access the path. --- diff --git a/Lib/test/test_import.py b/Lib/test/test_import.py index 48443ea58010..cfed14284588 100644 --- a/Lib/test/test_import.py +++ b/Lib/test/test_import.py @@ -461,6 +461,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')