diff options
author | Barney Gale <barney.gale@gmail.com> | 2025-03-10 17:59:10 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-03-10 17:59:10 (GMT) |
commit | 5a484714c3497dd5c67a1469c0cc246bf1452892 (patch) | |
tree | 3b515770a5f1d9c32fabcd246cc98993c46d6130 /Lib/test/test_pathlib/support/lexical_path.py | |
parent | 93fc3d34f9285d337c1e19e84764b02629eaab68 (diff) | |
download | cpython-5a484714c3497dd5c67a1469c0cc246bf1452892.zip cpython-5a484714c3497dd5c67a1469c0cc246bf1452892.tar.gz cpython-5a484714c3497dd5c67a1469c0cc246bf1452892.tar.bz2 |
GH-130614: pathlib ABCs: revise test suite for Posix path joining (#131017)
Test Posix-flavoured `pathlib.types._JoinablePath` in a dedicated test
module. These tests cover `LexicalPosixPath`, `PurePosixPath` and
`PosixPath`, where `LexicalPosixPath` 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.py | 6 |
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 687d76f..27dec30 100644 --- a/Lib/test/test_pathlib/support/lexical_path.py +++ b/Lib/test/test_pathlib/support/lexical_path.py @@ -4,6 +4,7 @@ Simple implementation of JoinablePath, for use in pathlib tests. import os.path import pathlib.types +import posixpath class LexicalPath(pathlib.types._JoinablePath): @@ -31,3 +32,8 @@ class LexicalPath(pathlib.types._JoinablePath): def with_segments(self, *pathsegments): return type(self)(*pathsegments) + + +class LexicalPosixPath(LexicalPath): + __slots__ = () + parser = posixpath |