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.
This commit is contained in:
Barney Gale 2025-03-11 18:01:43 +00:00 committed by GitHub
parent e0bc9d2a0c
commit 3569e4a670
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 320 additions and 279 deletions

View file

@ -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 @@ def with_segments(self, *pathsegments):
class LexicalPosixPath(LexicalPath):
__slots__ = ()
parser = posixpath
class LexicalWindowsPath(LexicalPath):
__slots__ = ()
parser = ntpath