summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_posixpath.py
diff options
context:
space:
mode:
authorR David Murray <rdmurray@bitdance.com>2016-08-24 12:59:47 (GMT)
committerR David Murray <rdmurray@bitdance.com>2016-08-24 12:59:47 (GMT)
commit68854fdc1ebb32bc5d340cfb0501321034edaa2c (patch)
tree1be547df7b5cb4236406d32862c7d9ff3fc467e4 /Lib/test/test_posixpath.py
parent8578316697c27e5824cadb6f7a324f95445f6c1a (diff)
downloadcpython-68854fdc1ebb32bc5d340cfb0501321034edaa2c.zip
cpython-68854fdc1ebb32bc5d340cfb0501321034edaa2c.tar.gz
cpython-68854fdc1ebb32bc5d340cfb0501321034edaa2c.tar.bz2
#2466: fix test failure on windows.
Windows symlink support was introduced in python3, so we need to skip those tests differently on python2. Patch by Xiang Zhang.
Diffstat (limited to 'Lib/test/test_posixpath.py')
-rw-r--r--Lib/test/test_posixpath.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/test/test_posixpath.py b/Lib/test/test_posixpath.py
index 98bf0e0..deaa577 100644
--- a/Lib/test/test_posixpath.py
+++ b/Lib/test/test_posixpath.py
@@ -1,5 +1,4 @@
import unittest
-from test import symlink_support
from test import test_support, test_genericpath
from test import test_support as support
@@ -106,7 +105,7 @@ class PosixPathTest(unittest.TestCase):
f.write("foo")
f.close()
self.assertIs(posixpath.islink(test_support.TESTFN + "1"), False)
- if symlink_support.can_symlink():
+ if hasattr(os, 'symlink'):
os.symlink(test_support.TESTFN + "1", test_support.TESTFN + "2")
self.assertIs(posixpath.islink(test_support.TESTFN + "2"), True)
os.remove(test_support.TESTFN + "1")
@@ -211,7 +210,8 @@ class PosixPathTest(unittest.TestCase):
finally:
safe_rmdir(ABSTFN)
- @symlink_support.skip_unless_symlink
+ @unittest.skipUnless(hasattr(os, 'symlink'),
+ 'Requires functional symlink implementation')
def test_ismount_symlinks(self):
# Symlinks are never mountpoints.
try: