]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
GH-110109: Fix misplaced tests for `pathlib.WindowsPath.owner()` and `group()` (...
authorBarney Gale <barney.gale@gmail.com>
Sat, 18 Nov 2023 15:42:07 +0000 (15:42 +0000)
committerGitHub <noreply@github.com>
Sat, 18 Nov 2023 15:42:07 +0000 (15:42 +0000)
Move test methods from `WindowsPathAsPureTest` to `WindowsPathTest` unit.
The former test unit is intended to exercise only pure path functionality.

Lib/test/test_pathlib.py

index a53aae855dfb533f8081a03e0a0883316229c617..597483df4a5097b0dbeed5b3250dd44eb51a1ade 100644 (file)
@@ -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.
@@ -3738,6 +3728,16 @@ class WindowsPathTest(PathTest):
         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):