[Python-checkins] cpython (2.7): #2466: fix test failure on windows.

r.david.murray python-checkins at python.org
Wed Aug 24 09:00:11 EDT 2016


https://hg.python.org/cpython/rev/63799c310b69
changeset:   102888:63799c310b69
branch:      2.7
parent:      102858:75111791110b
user:        R David Murray <rdmurray at bitdance.com>
date:        Wed Aug 24 08:59:47 2016 -0400
summary:
  #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.

files:
  Lib/test/test_posixpath.py |  6 +++---
  1 files changed, 3 insertions(+), 3 deletions(-)


diff --git a/Lib/test/test_posixpath.py b/Lib/test/test_posixpath.py
--- 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 @@
             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 @@
         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:

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list