-
-
Notifications
You must be signed in to change notification settings - Fork 30k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bpo-28113: Convert Win32{Symlink,Junction}Tests to use support.TESTFN #12907
base: main
Are you sure you want to change the base?
bpo-28113: Convert Win32{Symlink,Junction}Tests to use support.TESTFN #12907
Conversation
There was a problem hiding this 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.
dirlink = 'dirlinktest' | ||
dirlink_target = os.path.dirname(filelink_target) | ||
missing_link = 'missing link' | ||
dirlink_target = os.path.join(support.TESTFN, 'win32_symlink_tests') |
There was a problem hiding this comment.
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.
@@ -2200,16 +2199,12 @@ def test_remove_directory_link_to_missing_target(self): | |||
# was created with target_is_dir==True. | |||
os.remove(self.missing_link) | |||
|
|||
@unittest.skip("currently fails; consider for improvement") |
There was a problem hiding this comment.
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.
When you're done making the requested changes, leave the comment: |
https://bugs.python.org/issue28113