diff options
author | Guido van Rossum <guido@python.org> | 2016-01-07 18:57:37 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2016-01-07 18:57:37 (GMT) |
commit | c3a8272705f26499d522ddda8ef0f07f8efcee40 (patch) | |
tree | fc3736cca0e539d525377ef7f91792cbae649573 /Lib/test/test_pathlib.py | |
parent | 16fb6748820c72123239c0f326e141a14cf39f85 (diff) | |
parent | bc9fddaf50df55f1b4d11ecb5598b95adacac707 (diff) | |
download | cpython-c3a8272705f26499d522ddda8ef0f07f8efcee40.zip cpython-c3a8272705f26499d522ddda8ef0f07f8efcee40.tar.gz cpython-c3a8272705f26499d522ddda8ef0f07f8efcee40.tar.bz2 |
Add another try/except PermissionError to avoid depending on listdir order. Fix issues #24120 and #26012. (Merge 3.4->3.5)
Diffstat (limited to 'Lib/test/test_pathlib.py')
-rw-r--r-- | Lib/test/test_pathlib.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Lib/test/test_pathlib.py b/Lib/test/test_pathlib.py index 138550f..4abf13d 100644 --- a/Lib/test/test_pathlib.py +++ b/Lib/test/test_pathlib.py @@ -1236,7 +1236,7 @@ class _BasePathTest(object): # | |-- dirD # | | `-- fileD # | `-- fileC - # |-- dirE + # |-- dirE # No permissions # |-- fileA # |-- linkA -> fileA # `-- linkB -> dirB @@ -1453,13 +1453,13 @@ class _BasePathTest(object): p = P(BASE) it = p.rglob("fileA") self.assertIsInstance(it, collections.Iterator) - # XXX cannot test because of symlink loops in the test setup - #_check(it, ["fileA"]) - #_check(p.rglob("fileB"), ["dirB/fileB"]) - #_check(p.rglob("*/fileA"), [""]) - #_check(p.rglob("*/fileB"), ["dirB/fileB"]) - #_check(p.rglob("file*"), ["fileA", "dirB/fileB"]) - # No symlink loops here + _check(it, ["fileA"]) + _check(p.rglob("fileB"), ["dirB/fileB"]) + _check(p.rglob("*/fileA"), []) + _check(p.rglob("*/fileB"), ["dirB/fileB", "dirB/linkD/fileB", + "linkB/fileB", "dirA/linkC/fileB"]) + _check(p.rglob("file*"), ["fileA", "dirB/fileB", + "dirC/fileC", "dirC/dirD/fileD"]) p = P(BASE, "dirC") _check(p.rglob("file*"), ["dirC/fileC", "dirC/dirD/fileD"]) _check(p.rglob("*/*"), ["dirC/dirD/fileD"]) |