Skip to content

Commit a894262

Browse files
committed
Fix tests on Windows
1 parent d9f6410 commit a894262

File tree

1 file changed

+9
-13
lines changed

1 file changed

+9
-13
lines changed

Lib/test/test_os/test_os.py

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2815,19 +2815,6 @@ def test_negative_fd_ebadf(self, fd):
28152815
if os.listdir in os.supports_fd:
28162816
with self.check_for_ebadf():
28172817
os.listdir(fd)
2818-
if support.MS_WINDOWS:
2819-
with self.check_for_ebadf():
2820-
os._path_exists(fd)
2821-
with self.check_for_ebadf():
2822-
os._path_lexists(fd)
2823-
with self.check_for_ebadf():
2824-
os._path_isdir(fd)
2825-
with self.check_for_ebadf():
2826-
os._path_isfile(fd)
2827-
with self.check_for_ebadf():
2828-
os._path_islink(fd)
2829-
with self.check_for_ebadf():
2830-
os._path_isjunction(fd)
28312818
if os.utime in os.supports_fd:
28322819
with self.check_for_ebadf():
28332820
os.utime(fd, (0, 0))
@@ -2854,6 +2841,15 @@ def test_negative_fd_ebadf(self, fd):
28542841
with self.check_for_ebadf():
28552842
os.scandir(fd)
28562843

2844+
if support.MS_WINDOWS:
2845+
import nt
2846+
self.assertFalse(nt._path_exists(fd))
2847+
self.assertFalse(nt._path_lexists(fd))
2848+
self.assertFalse(nt._path_isdir(fd))
2849+
self.assertFalse(nt._path_isfile(fd))
2850+
self.assertFalse(nt._path_islink(fd))
2851+
self.assertFalse(nt._path_isjunction(fd))
2852+
28572853
@unittest.skipUnless(hasattr(os, 'ftruncate'), 'test needs os.ftruncate()')
28582854
def test_ftruncate(self):
28592855
self.check(os.truncate, 0)

0 commit comments

Comments
 (0)