@@ -660,7 +660,7 @@ def test_realpath_invalid_unicode_paths(self, kwargs):
660660
661661 @os_helper .skip_unless_symlink
662662 @unittest .skipUnless (HAVE_GETFINALPATHNAME , 'need _getfinalpathname' )
663- @_parameterize ({}, {'strict' : True }, {'strict' : ALLOW_MISSING })
663+ @_parameterize ({}, {'strict' : True }, {'strict' : ALL_BUT_LAST }, { 'strict' : ALLOW_MISSING })
664664 def test_realpath_relative (self , kwargs ):
665665 ABSTFN = ntpath .abspath (os_helper .TESTFN )
666666 open (ABSTFN , "wb" ).close ()
@@ -893,7 +893,7 @@ def test_realpath_symlink_loops_raise(self):
893893
894894 @os_helper .skip_unless_symlink
895895 @unittest .skipUnless (HAVE_GETFINALPATHNAME , 'need _getfinalpathname' )
896- @_parameterize ({}, {'strict' : True }, {'strict' : ALLOW_MISSING })
896+ @_parameterize ({}, {'strict' : True }, {'strict' : ALL_BUT_LAST }, { 'strict' : ALLOW_MISSING })
897897 def test_realpath_symlink_prefix (self , kwargs ):
898898 ABSTFN = ntpath .abspath (os_helper .TESTFN )
899899 self .addCleanup (os_helper .unlink , ABSTFN + "3" )
@@ -931,6 +931,7 @@ def test_realpath_nul(self):
931931 tester ("ntpath.realpath('NUL')" , r'\\.\NUL' )
932932 tester ("ntpath.realpath('NUL', strict=False)" , r'\\.\NUL' )
933933 tester ("ntpath.realpath('NUL', strict=True)" , r'\\.\NUL' )
934+ tester ("ntpath.realpath('NUL', strict=ALL_BUT_LAST)" , r'\\.\NUL' )
934935 tester ("ntpath.realpath('NUL', strict=ALLOW_MISSING)" , r'\\.\NUL' )
935936
936937 @unittest .skipUnless (HAVE_GETFINALPATHNAME , 'need _getfinalpathname' )
@@ -955,7 +956,7 @@ def test_realpath_cwd(self):
955956
956957 self .assertPathEqual (test_file_long , ntpath .realpath (test_file_short ))
957958
958- for kwargs in {}, {'strict' : True }, {'strict' : ALLOW_MISSING }:
959+ for kwargs in {}, {'strict' : True }, {'strict' : ALL_BUT_LAST }, { 'strict' : ALLOW_MISSING }:
959960 with self .subTest (** kwargs ):
960961 with os_helper .change_cwd (test_dir_long ):
961962 self .assertPathEqual (
@@ -1059,7 +1060,7 @@ def check(path, mode, expected, errno=None):
10591060 check ("file/" , ALL_BUT_LAST , "/file" )
10601061 check ("file/" , True , "/file" )
10611062 check ("file/file2" , False , "/file/file2" )
1062- check ("file/file2" , ALLOW_MISSING , FileNotFoundError )
1063+ check ("file/file2" , ALLOW_MISSING , "/file/file2" )
10631064 check ("file/file2" , ALL_BUT_LAST , FileNotFoundError )
10641065 check ("file/file2" , True , FileNotFoundError )
10651066 check ("file/." , False , "/file" )
@@ -1093,7 +1094,7 @@ def check(path, mode, expected, errno=None):
10931094 check ("link/" , ALL_BUT_LAST , "/file" )
10941095 check ("link/" , True , "/file" )
10951096 check ("link/file2" , False , "/file/file2" )
1096- check ("link/file2" , ALLOW_MISSING , FileNotFoundError )
1097+ check ("link/file2" , ALLOW_MISSING , "/file/file2" )
10971098 check ("link/file2" , ALL_BUT_LAST , FileNotFoundError )
10981099 check ("link/file2" , True , FileNotFoundError )
10991100 check ("link/." , False , "/file" )
0 commit comments