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
52e2f970
Commit
52e2f970
authored
May 18, 2005
by
Stefan H. Holek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modified runalltests.py so it imports modules more like test.py, i.e.
without touching sys.path and without the help of imp.
parent
6f99c00f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
36 deletions
+30
-36
lib/python/Testing/ZopeTestCase/doc/CHANGES.txt
lib/python/Testing/ZopeTestCase/doc/CHANGES.txt
+2
-0
lib/python/Testing/ZopeTestCase/runalltests.py
lib/python/Testing/ZopeTestCase/runalltests.py
+14
-18
lib/python/Testing/ZopeTestCase/zopedoctest/runalltests.py
lib/python/Testing/ZopeTestCase/zopedoctest/runalltests.py
+14
-18
No files found.
lib/python/Testing/ZopeTestCase/doc/CHANGES.txt
View file @
52e2f970
...
...
@@ -17,6 +17,8 @@
Reusing the registry from other modules becomes a lot cleaner as a result.
- Made sure to close the REQUEST so as not to leak REQUEST._held. Thanks
to Sidnei da Silva.
- Modified runalltests.py so it imports modules more like test.py, i.e.
without touching sys.path and without the help of imp.
0.9.6
- Dropped support for Zope 2.5 as it lacks the setSecurityManager() API.
...
...
lib/python/Testing/ZopeTestCase/runalltests.py
View file @
52e2f970
...
...
@@ -15,38 +15,34 @@
Execute like:
python runalltests.py [-R]
$Id
:
$
$Id$
"""
__version__
=
'0.
2
.1'
__version__
=
'0.
3
.1'
import
os
,
sys
if
__name__
==
'__main__'
:
execfile
(
os
.
path
.
join
(
sys
.
path
[
0
],
'framework.py'
))
import
unittest
,
imp
import
unittest
TestRunner
=
unittest
.
TextTestRunner
suite
=
unittest
.
TestSuite
()
def
visitor
(
recursiv
e
,
dir
,
names
):
tests
=
[
n
[:
-
3
]
for
n
in
names
if
n
.
startswith
(
'test'
)
and
n
.
endswith
(
'.py'
)]
for
test
in
tests
:
saved_syspath
=
sys
.
path
[:]
sys
.
path
.
insert
(
0
,
dir
)
try
:
f
p
,
path
,
desc
=
imp
.
find_module
(
test
,
[
dir
])
m
=
imp
.
load_module
(
test
,
fp
,
path
,
desc
)
def
test_finder
(
recurs
e
,
dir
,
names
):
if
dir
==
os
.
curdir
or
'__init__.py'
in
names
:
parts
=
[
x
for
x
in
dir
[
len
(
os
.
curdir
):].
split
(
os
.
sep
)
if
x
]
tests
=
[
x
for
x
in
names
if
x
.
startswith
(
'test'
)
and
x
.
endswith
(
'.py'
)]
for
test
in
tests
:
modpath
=
parts
+
[
test
[:
-
3
]]
m
=
__import__
(
'.'
.
join
(
modpath
))
f
or
part
in
modpath
[
1
:]:
m
=
getattr
(
m
,
part
)
if
hasattr
(
m
,
'test_suite'
):
suite
.
addTest
(
m
.
test_suite
())
finally
:
fp
.
close
()
sys
.
path
[:]
=
saved_syspath
if
not
recursive
:
if
not
recurse
:
names
[:]
=
[]
if
__name__
==
'__main__'
:
os
.
path
.
walk
(
os
.
curdir
,
visito
r
,
'-R'
in
sys
.
argv
)
os
.
path
.
walk
(
os
.
curdir
,
test_finde
r
,
'-R'
in
sys
.
argv
)
TestRunner
().
run
(
suite
)
lib/python/Testing/ZopeTestCase/zopedoctest/runalltests.py
View file @
52e2f970
...
...
@@ -15,38 +15,34 @@
Execute like:
python runalltests.py [-R]
$Id
:
$
$Id$
"""
__version__
=
'0.
2
.1'
__version__
=
'0.
3
.1'
import
os
,
sys
if
__name__
==
'__main__'
:
execfile
(
os
.
path
.
join
(
sys
.
path
[
0
],
'framework.py'
))
import
unittest
,
imp
import
unittest
TestRunner
=
unittest
.
TextTestRunner
suite
=
unittest
.
TestSuite
()
def
visitor
(
recursiv
e
,
dir
,
names
):
tests
=
[
n
[:
-
3
]
for
n
in
names
if
n
.
startswith
(
'test'
)
and
n
.
endswith
(
'.py'
)]
for
test
in
tests
:
saved_syspath
=
sys
.
path
[:]
sys
.
path
.
insert
(
0
,
dir
)
try
:
f
p
,
path
,
desc
=
imp
.
find_module
(
test
,
[
dir
])
m
=
imp
.
load_module
(
test
,
fp
,
path
,
desc
)
def
test_finder
(
recurs
e
,
dir
,
names
):
if
dir
==
os
.
curdir
or
'__init__.py'
in
names
:
parts
=
[
x
for
x
in
dir
[
len
(
os
.
curdir
):].
split
(
os
.
sep
)
if
x
]
tests
=
[
x
for
x
in
names
if
x
.
startswith
(
'test'
)
and
x
.
endswith
(
'.py'
)]
for
test
in
tests
:
modpath
=
parts
+
[
test
[:
-
3
]]
m
=
__import__
(
'.'
.
join
(
modpath
))
f
or
part
in
modpath
[
1
:]:
m
=
getattr
(
m
,
part
)
if
hasattr
(
m
,
'test_suite'
):
suite
.
addTest
(
m
.
test_suite
())
finally
:
fp
.
close
()
sys
.
path
[:]
=
saved_syspath
if
not
recursive
:
if
not
recurse
:
names
[:]
=
[]
if
__name__
==
'__main__'
:
os
.
path
.
walk
(
os
.
curdir
,
visito
r
,
'-R'
in
sys
.
argv
)
os
.
path
.
walk
(
os
.
curdir
,
test_finde
r
,
'-R'
in
sys
.
argv
)
TestRunner
().
run
(
suite
)
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