[Python-checkins] cpython: Issue #13374: Skip deprecation tests for os.symlink() on Windows XP

victor.stinner python-checkins at python.org
Wed Nov 16 00:32:50 CET 2011


http://hg.python.org/cpython/rev/afc716e463a1
changeset:   73581:afc716e463a1
user:        Victor Stinner <victor.stinner at haypocalc.com>
date:        Wed Nov 16 00:34:44 2011 +0100
summary:
  Issue #13374: Skip deprecation tests for os.symlink() on Windows XP

To avoid a NotImplementedError('CreateSymbolicLinkW not found') error.

files:
  Lib/test/test_os.py |  9 ++++++++-
  1 files changed, 8 insertions(+), 1 deletions(-)


diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py
--- a/Lib/test/test_os.py
+++ b/Lib/test/test_os.py
@@ -1647,12 +1647,19 @@
                 (os.rmdir, filename),
                 (os.startfile, filename),
                 (os.stat, filename),
-                (os.symlink, filename, filename),
                 (os.unlink, filename),
                 (os.utime, filename),
             ):
                 self.assertRaises(DeprecationWarning, func, *args)
 
+    @support.skip_unless_symlink
+    def test_symlink(self):
+        filename = os.fsencode(support.TESTFN)
+        with warnings.catch_warnings():
+            warnings.simplefilter("error", DeprecationWarning)
+            self.assertRaises(DeprecationWarning,
+                              os.symlink, filename, filename)
+
 
 @support.reap_threads
 def test_main():

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


More information about the Python-checkins mailing list