Skip to content

Commit

Permalink
pythonGH-110109: Fix misplaced tests for `pathlib.WindowsPath.owner()…
Browse files Browse the repository at this point in the history
…` and `group()` (python#112239)

Move test methods from `WindowsPathAsPureTest` to `WindowsPathTest` unit.
The former test unit is intended to exercise only pure path functionality.
  • Loading branch information
barneygale authored and aisk committed Feb 11, 2024
1 parent 4ab1da8 commit 8bb5500
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions Lib/test/test_pathlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -1577,16 +1577,6 @@ class PosixPathAsPureTest(PurePosixPathTest):
class WindowsPathAsPureTest(PureWindowsPathTest):
cls = pathlib.WindowsPath

def test_owner(self):
P = self.cls
with self.assertRaises(pathlib.UnsupportedOperation):
P('c:/').owner()

def test_group(self):
P = self.cls
with self.assertRaises(pathlib.UnsupportedOperation):
P('c:/').group()


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

def test_owner(self):
P = self.cls
with self.assertRaises(pathlib.UnsupportedOperation):
P('c:/').owner()

def test_group(self):
P = self.cls
with self.assertRaises(pathlib.UnsupportedOperation):
P('c:/').group()


class PathSubclassTest(PathTest):
class cls(pathlib.Path):
Expand Down

0 comments on commit 8bb5500

Please sign in to comment.