Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2821644

Browse files
author
Victor Stinner
committed
Issue #13374: Skip deprecation tests for os.symlink() on Windows XP
To avoid a NotImplementedError('CreateSymbolicLinkW not found') error.
1 parent 19bd069 commit 2821644

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

Lib/test/test_os.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1647,12 +1647,19 @@ def test_deprecated(self):
16471647
(os.rmdir, filename),
16481648
(os.startfile, filename),
16491649
(os.stat, filename),
1650-
(os.symlink, filename, filename),
16511650
(os.unlink, filename),
16521651
(os.utime, filename),
16531652
):
16541653
self.assertRaises(DeprecationWarning, func, *args)
16551654

1655+
@support.skip_unless_symlink
1656+
def test_symlink(self):
1657+
filename = os.fsencode(support.TESTFN)
1658+
with warnings.catch_warnings():
1659+
warnings.simplefilter("error", DeprecationWarning)
1660+
self.assertRaises(DeprecationWarning,
1661+
os.symlink, filename, filename)
1662+
16561663

16571664
@support.reap_threads
16581665
def test_main():

0 commit comments

Comments
 (0)