Skip to content

Commit 370a7f1

Browse files
miss-islingtonaisk
andauthored
[3.11] gh-104242: Enable test_is_char_device_true in pathlib test on all platform (GH-116983) (GH-117277) (GH-117280)
(cherry picked from commit 17a82a1) (cherry picked from commit af1b0e9) Co-authored-by: AN Long <[email protected]>
1 parent d161061 commit 370a7f1

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)