summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_pathlib/test_pathlib.py
diff options
context:
space:
mode:
authorBarney Gale <barney.gale@gmail.com>2024-01-05 21:41:19 (GMT)
committerGitHub <noreply@github.com>2024-01-05 21:41:19 (GMT)
commit3c4e972d6d0945a5401377bed25b307a88b19c75 (patch)
tree80d9cf42eb428a1eeeff91abab7255051b35f4d2 /Lib/test/test_pathlib/test_pathlib.py
parent99854ce1701ca4d1a0d153e501a29f9eec306ce5 (diff)
downloadcpython-3c4e972d6d0945a5401377bed25b307a88b19c75.zip
cpython-3c4e972d6d0945a5401377bed25b307a88b19c75.tar.gz
cpython-3c4e972d6d0945a5401377bed25b307a88b19c75.tar.bz2
GH-113568: Stop raising auditing events from pathlib ABCs (#113571)
Raise auditing events in `pathlib.Path.glob()`, `rglob()` and `walk()`, but not in `pathlib._abc.PathBase` methods. Also move generation of a deprecation warning into `pathlib.Path` so it gets the right stack level.
Diffstat (limited to 'Lib/test/test_pathlib/test_pathlib.py')
-rw-r--r--Lib/test/test_pathlib/test_pathlib.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/test/test_pathlib/test_pathlib.py b/Lib/test/test_pathlib/test_pathlib.py
index 8f95c80..b64e6b5 100644
--- a/Lib/test/test_pathlib/test_pathlib.py
+++ b/Lib/test/test_pathlib/test_pathlib.py
@@ -1703,6 +1703,18 @@ class PathTest(test_pathlib_abc.DummyPathTest, PurePathTest):
with set_recursion_limit(recursion_limit):
list(base.glob('**/'))
+ def test_glob_recursive_no_trailing_slash(self):
+ P = self.cls
+ p = P(self.base)
+ with self.assertWarns(FutureWarning):
+ p.glob('**')
+ with self.assertWarns(FutureWarning):
+ p.glob('*/**')
+ with self.assertWarns(FutureWarning):
+ p.rglob('**')
+ with self.assertWarns(FutureWarning):
+ p.rglob('*/**')
+
@only_posix
class PosixPathTest(PathTest, PurePosixPathTest):