Skip to content

test_os windows failed test handling #4764

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

Merged
merged 80 commits into from
Apr 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
82dfef6
move test_os to independant tests
derlih Mar 25, 2023
e051061
test_closerange
derlih Mar 25, 2023
5080806
test_execve_invalid_env
derlih Mar 25, 2023
3356fe1
test_execve_with_empty_path
derlih Mar 25, 2023
01911f5
test_execvpe_with_bad_arglist
derlih Mar 25, 2023
9880389
remove test_iter from platform-dependent tests
derlih Mar 25, 2023
dd4dd4b
_execvpe_mockup
derlih Mar 25, 2023
aa44ee9
test_dup_nul
derlih Mar 25, 2023
5463487
test_get_set_inheritable
derlih Mar 25, 2023
e27c02f
test_get_set_inheritable_badf
derlih Mar 25, 2023
b6620ea
test_open
derlih Mar 25, 2023
296a519
test_exist_ok_existing_directory, test_exist_ok_s_isgid_directory
derlih Mar 25, 2023
1089205
check_waitpid
derlih Mar 25, 2023
11950c8
test_waitstatus_to_exitcode_windows
derlih Mar 25, 2023
cee0ddf
test_access_denied
derlih Mar 25, 2023
7e0e355
test_stat_block_device
derlih Mar 25, 2023
4a9e554
test_inheritable
derlih Mar 25, 2023
1291a5a
test_large_time
derlih Mar 25, 2023
f87d4cd
test_create_junction, test_unlink_removes_junction
derlih Mar 25, 2023
af17a33
test_kill_sigterm, test_kill_int
derlih Mar 25, 2023
a0b2f45
test_stat_unlink_race
derlih Mar 25, 2023
89365e2
test_putenv_unsetenv_error
derlih Mar 25, 2023
1dfc0a9
test_file_attributes
derlih Mar 25, 2023
88051cb
test_fdopen
derlih Mar 25, 2023
c16a6ea
test_fstat, test_fsync
derlih Mar 25, 2023
d906641
test_ftruncate, test_lseek, test_read, test_write
derlih Mar 25, 2023
f5c7f32
test_empty_path
derlih Mar 25, 2023
88a9907
test_removed_dir, test_removed_file
derlih Mar 25, 2023
961a53e
test_urandom_subprocess, test_urandom_fd_closed, test_urandom_fd_reop…
derlih Mar 25, 2023
69dec52
test_utime, test_utime_directory, test_utime_current, test_utime_curr…
derlih Mar 25, 2023
0e68f97
test_utime_invalid_arguments
derlih Mar 25, 2023
ca2aab2
test_file_attributes -> expectedFailureIfWindows
derlih Mar 25, 2023
e6b6137
test_access_denied -> expectedFailureIfWindows
derlih Mar 25, 2023
1ea5b58
test_stat_block_device -> expectedFailureIfWindows
derlih Mar 25, 2023
408a545
test_utime -> expectedFailureIfWindows
derlih Mar 25, 2023
f3f813f
test_utime_directory -> expectedFailureIfWindows
derlih Mar 25, 2023
9c07fac
test_utime_current -> expectedFailureIfWindows
derlih Mar 25, 2023
fda05ba
test_utime_current_old -> expectedFailureIfWindows
derlih Mar 25, 2023
5e252c5
test_large_time -> expectedFailureIfWindows
derlih Mar 25, 2023
bce276e
test_utime_invalid_arguments -> expectedFailureIfWindows
derlih Mar 25, 2023
ae71c46
test_putenv_unsetenv_error -> expectedFailureIfWindows
derlih Mar 25, 2023
a7ef291
test_exist_ok_existing_directory -> expectedFailureIfWindows
derlih Mar 25, 2023
f5c4008
test_exist_ok_s_isgid_directory -> expectedFailureIfWindows
derlih Mar 25, 2023
ace1a5e
test_urandom_subprocess -> expectedFailureIfWindows
derlih Mar 25, 2023
54c9811
test_urandom_fd_reopened -> expectedFailureIfWindows
derlih Mar 25, 2023
5ee7e22
test_execvpe_with_bad_arglist -> expectedFailureIfWindows
derlih Mar 25, 2023
0478b28
test_execve_invalid_env -> expectedFailureIfWindows
derlih Mar 25, 2023
89ce647
test_execve_with_empty_path -> expectedFailureIfWindows
derlih Mar 25, 2023
20d4ce3
test_fdopen -> expectedFailureIfWindows
derlih Mar 25, 2023
96e7990
test_ftruncate -> expectedFailureIfWindows
derlih Mar 25, 2023
d605872
test_lseek -> expectedFailureIfWindows
derlih Mar 25, 2023
8ce9105
test_read -> expectedFailureIfWindows
derlih Mar 25, 2023
bbac9bd
test_write -> expectedFailureIfWindows
derlih Mar 25, 2023
3a3da4d
test_inheritable -> expectedFailureIfWindows
derlih Mar 25, 2023
25336e9
test_kill_sigterm -> expectedFailureIfWindows
derlih Mar 25, 2023
f868751
test_kill_int -> expectedFailureIfWindows
derlih Mar 25, 2023
de530e2
test_create_junction -> expectedFailureIfWindows
derlih Mar 25, 2023
cd3a610
test_unlink_removes_junction -> expectedFailureIfWindows
derlih Mar 25, 2023
5ba2f82
test_stat_unlink_race -> expectedFailureIfWindows
derlih Mar 25, 2023
6e5a6f2
test_waitpid_windows -> expectedFailureIfWindows
derlih Mar 25, 2023
8d4aa13
test_waitstatus_to_exitcode -> expectedFailureIfWindows
derlih Mar 25, 2023
9e06414
test_waitpid -> expectedFailureIfWindows
derlih Mar 25, 2023
612d9b7
test_urandom_fd_closed -> expectedFailureIfWindows
derlih Mar 25, 2023
a55b244
revert test_waitpid
derlih Mar 25, 2023
b8f8092
revert test_waitstatus_to_exitcode
derlih Mar 25, 2023
1f96e52
test_waitstatus_to_exitcode_windows -> expectedFailureIfWindows
derlih Mar 25, 2023
4c3d415
test_removed_dir -> expectedFailureIfWindows
derlih Mar 25, 2023
0f162c8
test_removed_file -> expectedFailureIfWindows
derlih Mar 25, 2023
25a452e
test_empty_path -> expectedFailureIfWindows
derlih Mar 25, 2023
c5bd446
test_get_set_inheritable -> expectedFailureIfWindows
derlih Mar 25, 2023
0d1e40f
test_get_set_inheritable_badf -> expectedFailureIfWindows
derlih Mar 25, 2023
4876af1
test_open -> expectedFailureIfWindows
derlih Mar 25, 2023
955b480
test_dup_nul -> expectedFailureIfWindows
derlih Mar 25, 2023
6ccb320
add NOTE to comment
derlih Mar 25, 2023
d87afe1
test_closerange -> skipIf
derlih Mar 25, 2023
46b0813
test_fstat, test_fsync -> expectedFailureIfWindows
derlih Mar 25, 2023
9ec3c6e
adjust comment `os.* not implemented` -> `os.* not implemented yet fo…
derlih Mar 25, 2023
a3baa13
add comment for generated tests in TestInvalidFD
derlih Mar 25, 2023
746dec8
Revert adding test_os to platform independent tests
youknowone Mar 26, 2023
0748b5d
revert skip test_os for windows
youknowone Apr 20, 2023
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
1 change: 0 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,6 @@ jobs:
test_glob
test_importlib
test_io
test_iter
test_os
Copy link
Member

Choose a reason for hiding this comment

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

This is a big progress without regression. just failing on CI.
Because it is not easily fixed now, let's revert this like to skip test_os on windows, and merge it first.
And lets think about this fix later.

test_pathlib
test_posixpath
Expand Down
55 changes: 52 additions & 3 deletions Lib/test/test_os.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ def test_access(self):
os.close(f)
self.assertTrue(os.access(os_helper.TESTFN, os.W_OK))

@unittest.skipIf(sys.platform == "win32", "TODO: RUSTPYTHON, BrokenPipeError: (32, 'The process cannot access the file because it is being used by another process. (os error 32)')")
def test_closerange(self):
first = os.open(os_helper.TESTFN, os.O_CREAT|os.O_RDWR)
# We must allocate two consecutive file descriptors, otherwise
Expand Down Expand Up @@ -696,6 +697,7 @@ def check_file_attributes(self, result):
self.assertTrue(isinstance(result.st_file_attributes, int))
self.assertTrue(0 <= result.st_file_attributes <= 0xFFFFFFFF)

@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON os.stat return value doesnt have st_file_attributes attribute")
@unittest.skipUnless(sys.platform == "win32",
"st_file_attributes is Win32 specific")
def test_file_attributes(self):
Expand All @@ -717,6 +719,7 @@ def test_file_attributes(self):
result.st_file_attributes & stat.FILE_ATTRIBUTE_DIRECTORY,
stat.FILE_ATTRIBUTE_DIRECTORY)

@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON os.stat (PermissionError: [Errno 5] Access is denied.)")
@unittest.skipUnless(sys.platform == "win32", "Win32 specific tests")
def test_access_denied(self):
# Default to FindFirstFile WIN32_FIND_DATA when access is
Expand All @@ -738,6 +741,7 @@ def test_access_denied(self):
result = os.stat(fname)
self.assertNotEqual(result.st_size, 0)

@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON os.stat (PermissionError: [Errno 1] Incorrect function.)")
@unittest.skipUnless(sys.platform == "win32", "Win32 specific tests")
def test_stat_block_device(self):
# bpo-38030: os.stat fails for block devices
Expand Down Expand Up @@ -795,6 +799,7 @@ def _test_utime(self, set_time, filename=None):
self.assertEqual(st.st_atime_ns, atime_ns)
self.assertEqual(st.st_mtime_ns, mtime_ns)

@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON (AssertionError: 2.002003 != 1.002003 within 1e-06 delta (1.0000000000000002 difference))")
def test_utime(self):
def set_time(filename, ns):
# test the ns keyword parameter
Expand Down Expand Up @@ -862,6 +867,7 @@ def set_time(filename, ns):
os.utime(name, dir_fd=dirfd, ns=ns)
self._test_utime(set_time)

@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON (AssertionError: 2.002003 != 1.002003 within 1e-06 delta (1.0000000000000002 difference))")
def test_utime_directory(self):
def set_time(filename, ns):
# test calling os.utime() on a directory
Expand Down Expand Up @@ -890,12 +896,14 @@ def _test_utime_current(self, set_time):
self.assertAlmostEqual(st.st_mtime, current,
delta=delta, msg=msg)

@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON (AssertionError: 3359485824.516508 != 1679742912.516503 within 0.05 delta (1679742912.000005 difference) : st_time=3359485824.516508, current=1679742912.516503, dt=1679742912.000005)")
def test_utime_current(self):
def set_time(filename):
# Set to the current time in the new way
os.utime(self.fname)
self._test_utime_current(set_time)

@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON (AssertionError: 3359485824.5186944 != 1679742912.5186892 within 0.05 delta (1679742912.0000052 difference) : st_time=3359485824.5186944, current=1679742912.5186892, dt=1679742912.0000052)")
def test_utime_current_old(self):
def set_time(filename):
# Set to the current time in the old explicit way.
Expand All @@ -915,6 +923,7 @@ def get_file_system(self, path):
return buf.value
# return None if the filesystem is unknown

@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON (ModuleNotFoundError: No module named '_ctypes')")
def test_large_time(self):
# Many filesystems are limited to the year 2038. At least, the test
# pass with NTFS filesystem.
Expand All @@ -925,6 +934,7 @@ def test_large_time(self):
os.utime(self.fname, (large, large))
self.assertEqual(os.stat(self.fname).st_mtime, large)

@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON (AssertionError: NotImplementedError not raised)")
def test_utime_invalid_arguments(self):
# seconds and nanoseconds parameters are mutually exclusive
with self.assertRaises(ValueError):
Expand Down Expand Up @@ -1124,6 +1134,7 @@ def test_putenv_unsetenv(self):
stdout=subprocess.PIPE, text=True)
self.assertEqual(proc.stdout.rstrip(), repr(None))

@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON (AssertionError: ValueError not raised by putenv)")
# On OS X < 10.6, unsetenv() doesn't return a value (bpo-13415).
@support.requires_mac_ver(10, 6)
def test_putenv_unsetenv_error(self):
Expand Down Expand Up @@ -1615,6 +1626,7 @@ def test_mode(self):
self.assertEqual(os.stat(path).st_mode & 0o777, 0o555)
self.assertEqual(os.stat(parent).st_mode & 0o777, 0o775)

@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON os.umask not implemented yet for all platforms")
def test_exist_ok_existing_directory(self):
path = os.path.join(os_helper.TESTFN, 'dir1')
mode = 0o777
Expand All @@ -1629,6 +1641,7 @@ def test_exist_ok_existing_directory(self):
# Issue #25583: A drive root could raise PermissionError on Windows
os.makedirs(os.path.abspath('/'), exist_ok=True)

@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON os.umask not implemented yet for all platforms")
def test_exist_ok_s_isgid_directory(self):
path = os.path.join(os_helper.TESTFN, 'dir1')
S_ISGID = stat.S_ISGID
Expand Down Expand Up @@ -1813,6 +1826,7 @@ def get_urandom_subprocess(self, count):
self.assertEqual(len(stdout), count)
return stdout

@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON (ModuleNotFoundError: No module named 'os'")
def test_urandom_subprocess(self):
data1 = self.get_urandom_subprocess(16)
data2 = self.get_urandom_subprocess(16)
Expand Down Expand Up @@ -1897,6 +1911,7 @@ def test_urandom_failure(self):
"""
assert_python_ok('-c', code)

@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON on Windows (ModuleNotFoundError: No module named 'os')")
def test_urandom_fd_closed(self):
# Issue #21207: urandom() should reopen its fd to /dev/urandom if
# closed.
Expand All @@ -1911,6 +1926,7 @@ def test_urandom_fd_closed(self):
"""
rc, out, err = assert_python_ok('-Sc', code)

@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON (ModuleNotFoundError: No module named 'os'")
def test_urandom_fd_reopened(self):
# Issue #21207: urandom() should detect its fd to /dev/urandom
# changed to something else, and reopen it.
Expand Down Expand Up @@ -1971,7 +1987,8 @@ def mock_execve(name, *args):

try:
orig_execv = os.execv
orig_execve = os.execve
# NOTE: RUSTPYTHON os.execve not implemented yet for all platforms
orig_execve = getattr(os, "execve", None)
orig_defpath = os.defpath
os.execv = mock_execv
os.execve = mock_execve
Expand All @@ -1980,7 +1997,10 @@ def mock_execve(name, *args):
yield calls
finally:
os.execv = orig_execv
os.execve = orig_execve
if orig_execve:
os.execve = orig_execve
else:
del os.execve
os.defpath = orig_defpath

@unittest.skipUnless(hasattr(os, 'execv'),
Expand All @@ -1998,6 +2018,7 @@ def test_execv_with_bad_arglist(self):
self.assertRaises(ValueError, os.execv, 'notepad', ('',))
self.assertRaises(ValueError, os.execv, 'notepad', [''])

@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON os.execve not implemented yet for all platforms")
def test_execvpe_with_bad_arglist(self):
self.assertRaises(ValueError, os.execvpe, 'notepad', [], None)
self.assertRaises(ValueError, os.execvpe, 'notepad', [], {})
Expand Down Expand Up @@ -2057,6 +2078,7 @@ def test_internal_execvpe_str(self):
if os.name != "nt":
self._test_internal_execvpe(bytes)

@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON os.execve not implemented yet for all platforms")
def test_execve_invalid_env(self):
args = [sys.executable, '-c', 'pass']

Expand All @@ -2078,6 +2100,7 @@ def test_execve_invalid_env(self):
with self.assertRaises(ValueError):
os.execve(args[0], args, newenv)

@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON os.execve not implemented yet for all platforms")
@unittest.skipUnless(sys.platform == "win32", "Win32-specific test")
def test_execve_with_empty_path(self):
# bpo-32890: Check GetLastError() misuse
Expand Down Expand Up @@ -2136,7 +2159,13 @@ def helper(self):
self.check(getattr(os, f))
return helper
for f in singles:
locals()["test_"+f] = get_single(f)
# TODO: RUSTPYTHON: 'fstat' and 'fsync' currently fail on windows, so we've added the if
# statement here to wrap them. When completed remove the if clause and just leave a call to:
# locals()["test_"+f] = get_single(f)
if f in ("fstat", "fsync"):
locals()["test_"+f] = unittest.expectedFailureIfWindows("TODO: RUSTPYTHON fstat test (OSError: [Errno 18] There are no more files.")(get_single(f))
else:
locals()["test_"+f] = get_single(f)

def check(self, f, *args, **kwargs):
try:
Expand All @@ -2147,6 +2176,7 @@ def check(self, f, *args, **kwargs):
self.fail("%r didn't raise an OSError with a bad file descriptor"
% f)

@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON (AssertionError: <function fdopen at 0x1caa19ae6c0> didn't raise an OSError with a bad file descriptor)")
def test_fdopen(self):
self.check(os.fdopen, encoding="utf-8")

Expand Down Expand Up @@ -2187,15 +2217,18 @@ def test_fpathconf(self):
self.check(os.pathconf, "PC_NAME_MAX")
self.check(os.fpathconf, "PC_NAME_MAX")

@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON (AssertionError: <builtin_function_or_method object at 0x1f330cd8e60> didn't raise an OSError with a bad file descriptor)")
@unittest.skipUnless(hasattr(os, 'ftruncate'), 'test needs os.ftruncate()')
def test_ftruncate(self):
self.check(os.truncate, 0)
self.check(os.ftruncate, 0)

@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON (OSError: [Errno 18] There are no more files.)")
@unittest.skipUnless(hasattr(os, 'lseek'), 'test needs os.lseek()')
def test_lseek(self):
self.check(os.lseek, 0, 0)

@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON (OSError: [Errno 18] There are no more files.)")
@unittest.skipUnless(hasattr(os, 'read'), 'test needs os.read()')
def test_read(self):
self.check(os.read, 1)
Expand All @@ -2209,6 +2242,7 @@ def test_readv(self):
def test_tcsetpgrpt(self):
self.check(os.tcsetpgrp, 0)

@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON (OSError: [Errno 18] There are no more files.)")
@unittest.skipUnless(hasattr(os, 'write'), 'test needs os.write()')
def test_write(self):
self.check(os.write, b" ")
Expand All @@ -2217,6 +2251,7 @@ def test_write(self):
def test_writev(self):
self.check(os.writev, [b'abc'])

@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON os.get_inheritable not implemented yet for all platforms")
def test_inheritable(self):
self.check(os.get_inheritable)
self.check(os.set_inheritable, True)
Expand Down Expand Up @@ -2461,10 +2496,12 @@ def _kill(self, sig):
os.kill(proc.pid, sig)
self.assertEqual(proc.wait(), sig)

@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON (ModuleNotFoundError: No module named '_ctypes')")
def test_kill_sigterm(self):
# SIGTERM doesn't mean anything special, but make sure it works
self._kill(signal.SIGTERM)

@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON (ModuleNotFoundError: No module named '_ctypes')")
def test_kill_int(self):
# os.kill on Windows can take an int which gets set as the exit code
self._kill(100)
Expand Down Expand Up @@ -2822,6 +2859,7 @@ def tearDown(self):
if os.path.lexists(self.junction):
os.unlink(self.junction)

@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON (AttributeError: module '_winapi' has no attribute 'CreateJunction')")
def test_create_junction(self):
_winapi.CreateJunction(self.junction_target, self.junction)
self.assertTrue(os.path.lexists(self.junction))
Expand All @@ -2835,6 +2873,7 @@ def test_create_junction(self):
self.assertEqual(os.path.normcase("\\\\?\\" + self.junction_target),
os.path.normcase(os.readlink(self.junction)))

@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON (AttributeError: module '_winapi' has no attribute 'CreateJunction')")
def test_unlink_removes_junction(self):
_winapi.CreateJunction(self.junction_target, self.junction)
self.assertTrue(os.path.exists(self.junction))
Expand Down Expand Up @@ -2893,6 +2932,7 @@ def test_getfinalpathname_handles(self):

self.assertEqual(0, handle_delta)

@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON os.stat (PermissionError: [Errno 5] Access is denied.)")
def test_stat_unlink_race(self):
# bpo-46785: the implementation of os.stat() falls back to reading
# the parent directory if CreateFileW() fails with a permission
Expand Down Expand Up @@ -3041,6 +3081,7 @@ def test_waitstatus_to_exitcode(self):
with self.assertRaises(TypeError):
os.waitstatus_to_exitcode(0.0)

@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON os.spawnv not implemented yet for all platforms")
@unittest.skipUnless(sys.platform == 'win32', 'win32-specific test')
def test_waitpid_windows(self):
# bpo-40138: test os.waitpid() and os.waitstatus_to_exitcode()
Expand All @@ -3049,6 +3090,7 @@ def test_waitpid_windows(self):
code = f'import _winapi; _winapi.ExitProcess({STATUS_CONTROL_C_EXIT})'
self.check_waitpid(code, exitcode=STATUS_CONTROL_C_EXIT)

@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON (OverflowError: Python int too large to convert to Rust i32)")
@unittest.skipUnless(sys.platform == 'win32', 'win32-specific test')
def test_waitstatus_to_exitcode_windows(self):
max_exitcode = 2 ** 32 - 1
Expand Down Expand Up @@ -3936,6 +3978,7 @@ def test_cpu_count(self):


class FDInheritanceTests(unittest.TestCase):
@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON os.get_inheritable not implemented yet for all platforms")
def test_get_set_inheritable(self):
fd = os.open(__file__, os.O_RDONLY)
self.addCleanup(os.close, fd)
Expand Down Expand Up @@ -3980,6 +4023,7 @@ def test_get_set_inheritable_o_path(self):
os.set_inheritable(fd, False)
self.assertEqual(os.get_inheritable(fd), False)

@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON os.get_inheritable not implemented yet for all platforms")
def test_get_set_inheritable_badf(self):
fd = os_helper.make_bad_fd()

Expand All @@ -3995,6 +4039,7 @@ def test_get_set_inheritable_badf(self):
os.set_inheritable(fd, False)
self.assertEqual(ctx.exception.errno, errno.EBADF)

@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON os.get_inheritable not implemented yet for all platforms")
def test_open(self):
fd = os.open(__file__, os.O_RDONLY)
self.addCleanup(os.close, fd)
Expand Down Expand Up @@ -4023,6 +4068,7 @@ def test_dup_standard_stream(self):
self.addCleanup(os.close, fd)
self.assertGreater(fd, 0)

@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON os.dup not implemented yet for all platforms")
@unittest.skipUnless(sys.platform == 'win32', 'win32-specific test')
def test_dup_nul(self):
# os.dup() was creating inheritable fds for character files.
Expand Down Expand Up @@ -4331,6 +4377,7 @@ def test_fspath_protocol_bytes(self):
self.assertEqual(fspath,
os.path.join(os.fsencode(self.path),bytes_filename))

@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON entry.is_dir() is False")
def test_removed_dir(self):
path = os.path.join(self.path, 'dir')

Expand All @@ -4353,6 +4400,7 @@ def test_removed_dir(self):
self.assertRaises(FileNotFoundError, entry.stat)
self.assertRaises(FileNotFoundError, entry.stat, follow_symlinks=False)

@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON entry.is_file() is False")
def test_removed_file(self):
entry = self.create_file_entry()
os.unlink(entry.path)
Expand Down Expand Up @@ -4451,6 +4499,7 @@ def test_fd(self):
st = os.stat(entry.name, dir_fd=fd, follow_symlinks=False)
self.assertEqual(entry.stat(follow_symlinks=False), st)

@unittest.expectedFailureIfWindows("TODO: RUSTPYTHON (AssertionError: FileNotFoundError not raised by scandir)")
def test_empty_path(self):
self.assertRaises(FileNotFoundError, os.scandir, '')

Expand Down