Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-110109: Test pure functionality of pathlib.Path user subclasses #112242

Merged
merged 1 commit into from
Nov 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 4 additions & 12 deletions Lib/test/test_pathlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -1569,15 +1569,6 @@ class cls(pathlib.PurePath):
test_repr_roundtrips = None


@only_posix
class PosixPathAsPureTest(PurePosixPathTest):
cls = pathlib.PosixPath

@only_nt
class WindowsPathAsPureTest(PureWindowsPathTest):
cls = pathlib.WindowsPath


#
# Tests for the virtual classes.
#
Expand Down Expand Up @@ -1771,6 +1762,7 @@ class DummyPathTest(unittest.TestCase):
#

def setUp(self):
super().setUp()
pathmod = self.cls.pathmod
p = self.cls(BASE)
p.mkdir(parents=True)
Expand Down Expand Up @@ -2793,7 +2785,7 @@ class DummyPathWithSymlinksTest(DummyPathTest):
# Tests for the concrete classes.
#

class PathTest(DummyPathTest):
class PathTest(DummyPathTest, PurePathTest):
"""Tests for the FS-accessing functionalities of the Path classes."""
cls = pathlib.Path
can_symlink = os_helper.can_symlink()
Expand Down Expand Up @@ -3409,7 +3401,7 @@ def test_walk_many_open_files(self):


@only_posix
class PosixPathTest(PathTest):
class PosixPathTest(PathTest, PurePosixPathTest):
cls = pathlib.PosixPath

def test_absolute(self):
Expand Down Expand Up @@ -3585,7 +3577,7 @@ def test_from_uri_pathname2url(self):


@only_nt
class WindowsPathTest(PathTest):
class WindowsPathTest(PathTest, PureWindowsPathTest):
cls = pathlib.WindowsPath

def test_absolute(self):
Expand Down
Loading