Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Mark failing tests
  • Loading branch information
ShaharNaveh committed Aug 5, 2025
commit 5844b723578a479f2d75587b6f728b5c8ca2ef57
40 changes: 40 additions & 0 deletions Lib/test/test_ntpath.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ def test_splitdrive(self):
tester('ntpath.splitdrive("//?/UNC/server/share/dir")',
("//?/UNC/server/share", "/dir"))

# TODO: RUSTPYTHON
@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON")
def test_splitdrive_invalid_paths(self):
splitdrive = ntpath.splitdrive
self.assertEqual(splitdrive('\\\\ser\x00ver\\sha\x00re\\di\x00r'),
Expand Down Expand Up @@ -236,6 +238,8 @@ def test_splitroot(self):
tester('ntpath.splitroot(" :/foo")', (" :", "/", "foo"))
tester('ntpath.splitroot("/:/foo")', ("", "/", ":/foo"))

# TODO: RUSTPYTHON
@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON")
def test_splitroot_invalid_paths(self):
splitroot = ntpath.splitroot
self.assertEqual(splitroot('\\\\ser\x00ver\\sha\x00re\\di\x00r'),
Expand Down Expand Up @@ -264,6 +268,8 @@ def test_split(self):
tester('ntpath.split("c:/")', ('c:/', ''))
tester('ntpath.split("//conky/mountpoint/")', ('//conky/mountpoint/', ''))

# TODO: RUSTPYTHON
@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON")
def test_split_invalid_paths(self):
split = ntpath.split
self.assertEqual(split('c:\\fo\x00o\\ba\x00r'),
Expand Down Expand Up @@ -386,6 +392,8 @@ def test_join(self):
tester("ntpath.join('D:a', './c:b')", 'D:a\\.\\c:b')
tester("ntpath.join('D:/a', './c:b')", 'D:\\a\\.\\c:b')

# TODO: RUSTPYTHON
@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON")
def test_normcase(self):
normcase = ntpath.normcase
self.assertEqual(normcase(''), '')
Expand All @@ -401,6 +409,8 @@ def test_normcase(self):
self.assertEqual(normcase('\u03a9\u2126'.encode()),
expected.encode())

# TODO: RUSTPYTHON
@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON")
def test_normcase_invalid_paths(self):
normcase = ntpath.normcase
self.assertEqual(normcase('abc\x00def'), 'abc\x00def')
Expand Down Expand Up @@ -458,6 +468,8 @@ def test_normpath(self):
tester("ntpath.normpath('\\\\')", '\\\\')
tester("ntpath.normpath('//?/UNC/server/share/..')", '\\\\?\\UNC\\server\\share\\')

# TODO: RUSTPYTHON
@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON")
def test_normpath_invalid_paths(self):
normpath = ntpath.normpath
self.assertEqual(normpath('fo\x00o'), 'fo\x00o')
Expand Down Expand Up @@ -650,6 +662,8 @@ def test_realpath_relative(self, kwargs):
os.symlink(ABSTFN, ntpath.relpath(ABSTFN + "1"))
self.assertPathEqual(ntpath.realpath(ABSTFN + "1", **kwargs), ABSTFN)

# TODO: RUSTPYTHON
@unittest.expectedFailure
@os_helper.skip_unless_symlink
@unittest.skipUnless(HAVE_GETFINALPATHNAME, 'need _getfinalpathname')
def test_realpath_broken_symlinks(self):
Expand Down Expand Up @@ -976,6 +990,8 @@ def test_realpath_permission(self):

self.assertPathEqual(test_file, ntpath.realpath(test_file_short))

# TODO: RUSTPYTHON
@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON; ValueError: illegal environment variable name")
def test_expandvars(self):
with os_helper.EnvironmentVarGuard() as env:
env.clear()
Expand All @@ -1002,6 +1018,8 @@ def test_expandvars(self):
tester('ntpath.expandvars("\'%foo%\'%bar")', "\'%foo%\'%bar")
tester('ntpath.expandvars("bar\'%foo%")', "bar\'%foo%")

# TODO: RUSTPYTHON
@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON; ValueError: illegal environment variable name")
@unittest.skipUnless(os_helper.FS_NONASCII, 'need os_helper.FS_NONASCII')
def test_expandvars_nonascii(self):
def check(value, expected):
Expand All @@ -1022,6 +1040,8 @@ def check(value, expected):
check('%spam%bar', '%sbar' % nonascii)
check('%{}%bar'.format(nonascii), 'ham%sbar' % nonascii)

# TODO: RUSTPYTHON
@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON")
def test_expanduser(self):
tester('ntpath.expanduser("test")', 'test')

Expand Down Expand Up @@ -1116,6 +1136,8 @@ def test_abspath(self):
drive, _ = ntpath.splitdrive(cwd_dir)
tester('ntpath.abspath("/abc/")', drive + "\\abc")

# TODO: RUSTPYTHON
@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON")
def test_abspath_invalid_paths(self):
abspath = ntpath.abspath
if sys.platform == 'win32':
Expand Down Expand Up @@ -1279,6 +1301,8 @@ def test_ismount(self):
self.assertTrue(ntpath.ismount(b"\\\\localhost\\c$"))
self.assertTrue(ntpath.ismount(b"\\\\localhost\\c$\\"))

# TODO: RUSTPYTHON
@unittest.skipIf(sys.platform == 'win32', "TODO: RUSTPYTHON; crash")
def test_ismount_invalid_paths(self):
ismount = ntpath.ismount
self.assertFalse(ismount("c:\\\udfff"))
Expand Down Expand Up @@ -1420,6 +1444,8 @@ def test_isfile_anonymous_pipe(self):
os.close(pr)
os.close(pw)

# TODO: RUSTPYTHON
@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON")
@unittest.skipIf(sys.platform != 'win32', "windows only")
def test_isfile_named_pipe(self):
import _winapi
Expand All @@ -1432,6 +1458,8 @@ def test_isfile_named_pipe(self):
finally:
_winapi.CloseHandle(h)

# TODO: RUSTPYTHON
@unittest.expectedFailure
@unittest.skipIf(sys.platform != 'win32', "windows only")
def test_con_device(self):
self.assertFalse(os.path.isfile(r"\\.\CON"))
Expand Down Expand Up @@ -1462,6 +1490,8 @@ def test_fast_paths_in_use(self):
self.assertTrue(os.path.lexists is nt._path_lexists)
self.assertFalse(inspect.isfunction(os.path.lexists))

# TODO: RUSTPYTHON
@unittest.expectedFailure
@unittest.skipIf(os.name != 'nt', "Dev Drives only exist on Win32")
def test_isdevdrive(self):
# Result may be True or False, but shouldn't raise
Expand All @@ -1487,6 +1517,16 @@ class NtCommonTest(test_genericpath.CommonTest, unittest.TestCase):
pathmodule = ntpath
attributes = ['relpath']

# TODO: RUSTPYTHON
@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON; ValueError: illegal environment variable name")
def test_expandvars(self):
return super().test_expandvars()

# TODO: RUSTPYTHON
@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON; ValueError: illegal environment variable name")
def test_expandvars_nonascii(self):
return super().test_expandvars_nonascii()


class PathLikeTests(NtpathTestCase):

Expand Down
8 changes: 8 additions & 0 deletions Lib/test/test_posixpath.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,8 @@ def test_dirname(self):
self.assertEqual(posixpath.dirname(b"////foo"), b"////")
self.assertEqual(posixpath.dirname(b"//foo//bar"), b"//foo")

# TODO: RUSTPYTHON
@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON")
def test_islink(self):
self.assertIs(posixpath.islink(TESTFN + "1"), False)
self.assertIs(posixpath.lexists(TESTFN + "2"), False)
Expand Down Expand Up @@ -234,6 +236,8 @@ def test_ismount_invalid_paths(self):
self.assertIs(posixpath.ismount('/\x00'), False)
self.assertIs(posixpath.ismount(b'/\x00'), False)

# TODO: RUSTPYTHON
@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON")
@os_helper.skip_unless_symlink
def test_ismount_symlinks(self):
# Symlinks are never mountpoints.
Expand Down Expand Up @@ -1084,11 +1088,15 @@ def check_error(exc, paths):
['usr/lib/', b'/usr/lib/python3'])


# TODO: RUSTPYTHON
@unittest.skip("TODO: RUSTPYTHON, flaky tests")
class PosixCommonTest(test_genericpath.CommonTest, unittest.TestCase):
pathmodule = posixpath
attributes = ['relpath', 'samefile', 'sameopenfile', 'samestat']


# TODO: RUSTPYTHON
@unittest.skipIf(os.getenv("CI"), "TODO: RUSTPYTHON, FileExistsError: (17, 'File exists (os error 17)')")
class PathLikeTests(unittest.TestCase):

path = posixpath
Expand Down
Loading