Skip to content

Commit

Permalink
[3.12] pythongh-104242: Enable test_is_char_device_true in pathlib te…
Browse files Browse the repository at this point in the history
…st 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)
  • Loading branch information
aisk authored and miss-islington committed Mar 27, 2024
1 parent d161061 commit c17bfa9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Lib/test/test_pathlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -2430,15 +2430,15 @@ def test_is_char_device_false(self):
self.assertIs((P / 'fileA\x00').is_char_device(), False)

def test_is_char_device_true(self):
# Under Unix, /dev/null should generally be a char device.
P = self.cls('/dev/null')
# os.devnull should generally be a char device.
P = self.cls(os.devnull)
if not P.exists():
self.skipTest("/dev/null required")
self.skipTest("null device required")
self.assertTrue(P.is_char_device())
self.assertFalse(P.is_block_device())
self.assertFalse(P.is_file())
self.assertIs(self.cls('/dev/null\udfff').is_char_device(), False)
self.assertIs(self.cls('/dev/null\x00').is_char_device(), False)
self.assertIs(self.cls(f'{os.devnull}\udfff').is_char_device(), False)
self.assertIs(self.cls(f'{os.devnull}\x00').is_char_device(), False)

def test_pickling_common(self):
p = self.cls(BASE, 'fileA')
Expand Down

0 comments on commit c17bfa9

Please sign in to comment.