]> granicus.if.org Git - python/commitdiff
Issue #13374: Skip deprecation tests for os.symlink() on Windows XP
authorVictor Stinner <victor.stinner@haypocalc.com>
Tue, 15 Nov 2011 23:34:44 +0000 (00:34 +0100)
committerVictor Stinner <victor.stinner@haypocalc.com>
Tue, 15 Nov 2011 23:34:44 +0000 (00:34 +0100)
To avoid a NotImplementedError('CreateSymbolicLinkW not found') error.

Lib/test/test_os.py

index ec2877e5df0441235d54490ac183b2128f247cb0..a3b99a3366e182a0cd5474e4173eb69210155a31 100644 (file)
@@ -1647,12 +1647,19 @@ class Win32DeprecatedBytesAPI(unittest.TestCase):
                 (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():