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 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:
parent
e0bc9d2a0c
commit
3569e4a670
4 changed files with 320 additions and 279 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue