summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAN Long <aisk@users.noreply.github.com>2024-03-27 08:42:37 (GMT)
committerGitHub <noreply@github.com>2024-03-27 08:42:37 (GMT)
commit17a82a1d16a46b6c008240bcc698619419ce5554 (patch)
tree17ef0404ecf20e5538b70aeae3ec256d652c8064
parent932194dc0009ef528f19c2d9dedda196533d55d0 (diff)
downloadcpython-17a82a1d16a46b6c008240bcc698619419ce5554.zip
cpython-17a82a1d16a46b6c008240bcc698619419ce5554.tar.gz
cpython-17a82a1d16a46b6c008240bcc698619419ce5554.tar.bz2
[3.12] gh-104242: Enable test_is_char_device_true in pathlib test on all platform (GH-116983) (GH-117277)
(cherry picked from commit af1b0e94400d1bf732466d675054df8cf7dfb62d)
-rw-r--r--Lib/test/test_pathlib.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/test/test_pathlib.py b/Lib/test/test_pathlib.py
index ec105ae..ca604df 100644
--- a/Lib/test/test_pathlib.py
+++ b/Lib/test/test_pathlib.py
@@ -2634,15 +2634,15 @@ class _BasePathTest(object):
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')