summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBarney Gale <barney.gale@gmail.com>2023-11-18 15:42:07 (GMT)
committerGitHub <noreply@github.com>2023-11-18 15:42:07 (GMT)
commit9c7c8bacc140b0ce7bbb17b1756a1ea9fb376983 (patch)
treec7f1c842014f371dfa101513172bcdbe0019fda9
parent91d17305414923ae3f1cf98108ca42c50e60c8ea (diff)
downloadcpython-9c7c8bacc140b0ce7bbb17b1756a1ea9fb376983.zip
cpython-9c7c8bacc140b0ce7bbb17b1756a1ea9fb376983.tar.gz
cpython-9c7c8bacc140b0ce7bbb17b1756a1ea9fb376983.tar.bz2
GH-110109: Fix misplaced tests for `pathlib.WindowsPath.owner()` and `group()` (#112239)
Move test methods from `WindowsPathAsPureTest` to `WindowsPathTest` unit. The former test unit is intended to exercise only pure path functionality.
-rw-r--r--Lib/test/test_pathlib.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/Lib/test/test_pathlib.py b/Lib/test/test_pathlib.py
index a53aae8..597483d 100644
--- a/Lib/test/test_pathlib.py
+++ b/Lib/test/test_pathlib.py
@@ -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):