Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
3169ebae
Commit
3169ebae
authored
Oct 28, 2016
by
Serhiy Storchaka
Browse files
Options
Browse Files
Download
Plain Diff
Issue #28353: Make test_os.WalkTests.test_walk_bad_dir stable.
parents
833d73c7
3dc70e8a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
10 deletions
+15
-10
Lib/test/test_os.py
Lib/test/test_os.py
+15
-10
No files found.
Lib/test/test_os.py
View file @
3169ebae
...
@@ -989,16 +989,21 @@ class WalkTests(unittest.TestCase):
...
@@ -989,16 +989,21 @@ class WalkTests(unittest.TestCase):
errors
=
[]
errors
=
[]
walk_it
=
self
.
walk
(
self
.
walk_path
,
onerror
=
errors
.
append
)
walk_it
=
self
.
walk
(
self
.
walk_path
,
onerror
=
errors
.
append
)
root
,
dirs
,
files
=
next
(
walk_it
)
root
,
dirs
,
files
=
next
(
walk_it
)
self
.
assertFalse
(
errors
)
self
.
assertEqual
(
errors
,
[])
dir1
=
dirs
[
0
]
dir1
=
'SUB1'
dir1new
=
dir1
+
'.new'
path1
=
os
.
path
.
join
(
root
,
dir1
)
os
.
rename
(
os
.
path
.
join
(
root
,
dir1
),
os
.
path
.
join
(
root
,
dir1new
))
path1new
=
os
.
path
.
join
(
root
,
dir1
+
'.new'
)
roots
=
[
r
for
r
,
d
,
f
in
walk_it
]
os
.
rename
(
path1
,
path1new
)
self
.
assertTrue
(
errors
)
try
:
self
.
assertNotIn
(
os
.
path
.
join
(
root
,
dir1
),
roots
)
roots
=
[
r
for
r
,
d
,
f
in
walk_it
]
self
.
assertNotIn
(
os
.
path
.
join
(
root
,
dir1new
),
roots
)
self
.
assertTrue
(
errors
)
for
dir2
in
dirs
[
1
:]:
self
.
assertNotIn
(
path1
,
roots
)
self
.
assertIn
(
os
.
path
.
join
(
root
,
dir2
),
roots
)
self
.
assertNotIn
(
path1new
,
roots
)
for
dir2
in
dirs
:
if
dir2
!=
dir1
:
self
.
assertIn
(
os
.
path
.
join
(
root
,
dir2
),
roots
)
finally
:
os
.
rename
(
path1new
,
path1
)
@
unittest
.
skipUnless
(
hasattr
(
os
,
'fwalk'
),
"Test needs os.fwalk()"
)
@
unittest
.
skipUnless
(
hasattr
(
os
,
'fwalk'
),
"Test needs os.fwalk()"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment