summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_pathlib/support/lexical_path.py
diff options
context:
space:
mode:
authorBarney Gale <barney.gale@gmail.com>2025-03-11 18:01:43 (GMT)
committerGitHub <noreply@github.com>2025-03-11 18:01:43 (GMT)
commit3569e4a670bc6a02f1bb1baf08ecfb85c63755fb (patch)
tree82adc8f3a65bddc63389cd6308ec2ab0cdbde585 /Lib/test/test_pathlib/support/lexical_path.py
parente0bc9d2a0c448cf46df233f8d84344c1f55a190f (diff)
downloadcpython-3569e4a670bc6a02f1bb1baf08ecfb85c63755fb.zip
cpython-3569e4a670bc6a02f1bb1baf08ecfb85c63755fb.tar.gz
cpython-3569e4a670bc6a02f1bb1baf08ecfb85c63755fb.tar.bz2
GH-130614: pathlib ABCs: revise test suite for Windows path joining (#131016)
Test Windows-flavoured `pathlib.types._JoinablePath` in a dedicated test module. These tests cover `LexicalWindowsPath`, `PureWindowsPath` and `WindowsPath`, where `LexicalWindowsPath` is a simple implementation of `_JoinablePath` for use in tests.
Diffstat (limited to 'Lib/test/test_pathlib/support/lexical_path.py')
-rw-r--r--Lib/test/test_pathlib/support/lexical_path.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_pathlib/support/lexical_path.py b/Lib/test/test_pathlib/support/lexical_path.py
index 27dec30..6298513 100644
--- a/Lib/test/test_pathlib/support/lexical_path.py
+++ b/Lib/test/test_pathlib/support/lexical_path.py
@@ -2,6 +2,7 @@
Simple implementation of JoinablePath, for use in pathlib tests.
"""
+import ntpath
import os.path
import pathlib.types
import posixpath
@@ -37,3 +38,8 @@ class LexicalPath(pathlib.types._JoinablePath):
class LexicalPosixPath(LexicalPath):
__slots__ = ()
parser = posixpath
+
+
+class LexicalWindowsPath(LexicalPath):
+ __slots__ = ()
+ parser = ntpath