Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
eb938746
Commit
eb938746
authored
Aug 06, 2004
by
Stefan H. Holek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made test.py follow symbolic links (backport from Z3 test.py).
parent
1b50a347
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
3 deletions
+23
-3
doc/CHANGES.txt
doc/CHANGES.txt
+2
-0
test.py
test.py
+21
-3
No files found.
doc/CHANGES.txt
View file @
eb938746
...
...
@@ -26,6 +26,8 @@ Zope Changes
Features added
- Made test.py follow symbolic links on POSIX systems.
- added utilities/reindex_catalog.py to perform ZCatalog maintenance
operations from the command line (through zopectl)
...
...
test.py
View file @
eb938746
...
...
@@ -471,10 +471,10 @@ def find_tests(rx):
global
finder
finder
=
TestFileFinder
(
pathinit
.
libdir
)
if
test_dir
:
walkdir
=
os
.
path
.
real
path
(
os
.
path
.
join
(
pathinit
.
cwd
,
test_dir
))
walkdir
=
os
.
path
.
abs
path
(
os
.
path
.
join
(
pathinit
.
cwd
,
test_dir
))
else
:
walkdir
=
pathinit
.
libdir
os
.
path
.
walk
(
walkdir
,
finder
.
visit
,
rx
)
walk_with_symlinks
(
walkdir
,
finder
.
visit
,
rx
)
return
finder
.
files
def
package_import
(
modname
):
...
...
@@ -608,6 +608,24 @@ def runner(files, test_filter, debug):
else
:
raise
def
walk_with_symlinks
(
path
,
visit
,
arg
):
"""Like os.path.walk, but follows symlinks on POSIX systems.
This could theoretically result in an infinite loop, if you create symlink
cycles in your Zope sandbox, so don't do that.
"""
try
:
names
=
os
.
listdir
(
path
)
except
os
.
error
:
return
visit
(
arg
,
path
,
names
)
exceptions
=
(
os
.
curdir
,
os
.
pardir
)
for
name
in
names
:
if
name
not
in
exceptions
:
name
=
os
.
path
.
join
(
path
,
name
)
if
os
.
path
.
isdir
(
name
):
walk_with_symlinks
(
name
,
visit
,
arg
)
def
remove_stale_bytecode
(
arg
,
dirname
,
names
):
names
=
map
(
os
.
path
.
normcase
,
names
)
for
name
in
names
:
...
...
@@ -628,7 +646,7 @@ def main(module_filter, test_filter, libdir):
pathinit
=
PathInit
(
build
,
libdir
)
if
not
keepStaleBytecode
:
os
.
path
.
walk
(
pathinit
.
home
,
remove_stale_bytecode
,
None
)
walk_with_symlinks
(
pathinit
.
home
,
remove_stale_bytecode
,
None
)
# Load configuration
if
config_file
:
...
...
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