Skip to content

bpo-28113: Convert Win32{Symlink,Junction}Tests to use support.TESTFN#12907

Draft
berkerpeksag wants to merge 1 commit intopython:mainfrom
berkerpeksag:bpo-28113-createsymboliclinkw
Draft

bpo-28113: Convert Win32{Symlink,Junction}Tests to use support.TESTFN#12907
berkerpeksag wants to merge 1 commit intopython:mainfrom
berkerpeksag:bpo-28113-createsymboliclinkw

Conversation

@berkerpeksag
Copy link
Copy Markdown
Member

@berkerpeksag berkerpeksag commented Apr 22, 2019

Copy link
Copy Markdown
Contributor

@taleinat taleinat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that Win32JunctionTests also uses os.path.dirname(os.path.abspath(__file__)); that should be amended as well.

Comment thread Lib/test/test_os.py
dirlink = 'dirlinktest'
dirlink_target = os.path.dirname(filelink_target)
missing_link = 'missing link'
dirlink_target = os.path.join(support.TESTFN, 'win32_symlink_tests')
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

support.TESTFN is just a path, but not an existing directory.

Perhaps add something the following to setUp()?

        tempdir = tempfile.TemporaryDirectory(prefix=support.TESTFN)
        self.addCleanup(tempdir.cleanup)

        self.dirlink_target = os.path.join(tempdir , 'win32_symlink_tests')
        self.filelink_target = os.path.join(self.dirlink_target, support.TESTFN)
        self.dirlink = os.path.join(tempdir , 'dirlinktest')
        self.filelink = os.path.join(tempdir , 'filelinktest')
        self.missing_link = os.path.join(tempdir , 'missinglinktest')

With this all of the other existence checks and cleanups may be removed.

Comment thread Lib/test/test_os.py
# was created with target_is_dir==True.
os.remove(self.missing_link)

@unittest.skip("currently fails; consider for improvement")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this no longer skipped: has this behavior been implemented?

Likewise for the next test below.

@bedevere-bot
Copy link
Copy Markdown

When you're done making the requested changes, leave the comment: I have made the requested changes; please review again.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jan 1, 2026

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions Bot added the stale Stale PR or inactive for long period of time. label Jan 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting changes skip news stale Stale PR or inactive for long period of time. tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants