8000 [3.12] gh-104242: Enable test_is_char_device_true in pathlib test on … · miss-islington/cpython@c17bfa9 · GitHub
[go: up one dir, main page]

Skip to content

Commit c17bfa9

Browse files
aiskmiss-islington
authored andcommitted
[3.12] pythongh-104242: Enable test_is_char_device_true in pathlib test on all platform (pythonGH-116983) (pythonGH-117277)
(cherry picked from commit 17a82a1) Co-authored-by: AN Long <aisk@users.noreply.github.com> (cherry picked from commit af1b0e9)
1 parent d161061 commit c17bfa9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Lib/test/test_pathlib.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2430,15 +2430,15 @@ def test_is_char_device_false(self):
24302430
self.assertIs((P / 'fileA\x00').is_char_device(), False)
24312431

24322432
def test_is_char_device_true(self):
2433-
# Under Unix, /dev/null should generally be a char device.
2434-
P = self.cls('/dev/null')
2433+
# os.devnull should generally be a char device.
2434+
P = self.cls(os.devnull)
24352435
if not P.exists():
2436-
self.skipTest("/dev/null required")
2436+
self.skipTest("null device required")
24372437
self.assertTrue(P.is_char_device())
24382438
self.assertFalse(P.is_block_device())
24392439
self.assertFalse(P.is_file())
2440-
self.assertIs(self.cls('/dev/null\udfff').is_char_device(), False)
2441-
self.assertIs(self.cls('/dev/null\x00').is_char_device(), False)
2440+
self.assertIs(self.cls(f'{os.devnull}\udfff').is_char_device(), False)
2441+
self.assertIs(self.cls(f'{os.devnull}\x00').is_char_device(), False)
24422442

24432443
def test_pickling_common(self):
24442444
p = self.cls(BASE, 'fileA')

0 commit comments

Comments
 (0)
0