mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
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.
This commit is contained in:
parent
93fc3d34f9
commit
5a484714c3
3 changed files with 55 additions and 23 deletions
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
import os.path
|
||||
import pathlib.types
|
||||
import posixpath
|
||||
|
||||
|
||||
class LexicalPath(pathlib.types._JoinablePath):
|
||||
|
|
@ -31,3 +32,8 @@ def __repr__(self):
|
|||
|
||||
def with_segments(self, *pathsegments):
|
||||
return type(self)(*pathsegments)
|
||||
|
||||
|
||||
class LexicalPosixPath(LexicalPath):
|
||||
__slots__ = ()
|
||||
parser = posixpath
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue