diff options
author | AN Long <aisk@users.noreply.github.com> | 2024-03-26 18:26:48 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-26 18:26:48 (GMT) |
commit | af1b0e94400d1bf732466d675054df8cf7dfb62d (patch) | |
tree | d5e44b02b069e9c83314aa5cf004515b4deb2d3d /Lib/test/test_pathlib | |
parent | 79be75735c9d77972112cecc8d7e1af28c176ed0 (diff) | |
download | cpython-af1b0e94400d1bf732466d675054df8cf7dfb62d.zip cpython-af1b0e94400d1bf732466d675054df8cf7dfb62d.tar.gz cpython-af1b0e94400d1bf732466d675054df8cf7dfb62d.tar.bz2 |
gh-104242: Enable test_is_char_device_true in pathlib test on all platform (GH-116983)
Diffstat (limited to 'Lib/test/test_pathlib')
-rw-r--r-- | Lib/test/test_pathlib/test_pathlib.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/test/test_pathlib/test_pathlib.py b/Lib/test/test_pathlib/test_pathlib.py index 6509c08..3a6f73c 100644 --- a/Lib/test/test_pathlib/test_pathlib.py +++ b/Lib/test/test_pathlib/test_pathlib.py @@ -1103,15 +1103,15 @@ class PathTest(test_pathlib_abc.DummyPathTest, PurePathTest): self.assertIs(self.cls(self.base, 'mysock\x00').is_socket(), 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_is_mount_root(self): if os.name == 'nt': |