Skip to content

Commit 17812ba

Browse files
barneygaleGlyphack
authored andcommitted
pythonGH-110109: Fix misplaced tests for pathlib.WindowsPath.owner() and group() (python#112239)
Move test methods from `WindowsPathAsPureTest` to `WindowsPathTest` unit. The former test unit is intended to exercise only pure path functionality.
1 parent e0dabe8 commit 17812ba

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

Diff for: Lib/test/test_pathlib.py

+10-10
Original file line numberDiff line numberDiff line change
@@ -1577,16 +1577,6 @@ class PosixPathAsPureTest(PurePosixPathTest):
15771577
class WindowsPathAsPureTest(PureWindowsPathTest):
15781578
cls = pathlib.WindowsPath
15791579

1580-
def test_owner(self):
1581-
P = self.cls
1582-
with self.assertRaises(pathlib.UnsupportedOperation):
1583-
P('c:/').owner()
1584-
1585-
def test_group(self):
1586-
P = self.cls
1587-
with self.assertRaises(pathlib.UnsupportedOperation):
1588-
P('c:/').group()
1589-
15901580

15911581
#
15921582
# Tests for the virtual classes.
@@ -3738,6 +3728,16 @@ def test_from_uri_pathname2url(self):
37383728
self.assertEqual(P.from_uri('file:' + pathname2url(r'c:\path\to\file')), P('c:/path/to/file'))
37393729
self.assertEqual(P.from_uri('file:' + pathname2url(r'\\server\path\to\file')), P('//server/path/to/file'))
37403730

3731+
def test_owner(self):
3732+
P = self.cls
3733+
with self.assertRaises(pathlib.UnsupportedOperation):
3734+
P('c:/').owner()
3735+
3736+
def test_group(self):
3737+
P = self.cls
3738+
with self.assertRaises(pathlib.UnsupportedOperation):
3739+
P('c:/').group()
3740+
37413741

37423742
class PathSubclassTest(PathTest):
37433743
class cls(pathlib.Path):

0 commit comments

Comments
 (0)