Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
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
Gwenaël Samain
cython
Commits
ab3d64a2
Commit
ab3d64a2
authored
Apr 25, 2011
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
enable forked test runs for pyregr test suite
parent
5c11dcd3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
74 additions
and
65 deletions
+74
-65
runtests.py
runtests.py
+74
-65
No files found.
runtests.py
View file @
ab3d64a2
...
...
@@ -588,8 +588,15 @@ class CythonRunTestCase(CythonCompileTestCase):
self
.
run_doctests
(
self
.
module
,
result
)
def
run_doctests
(
self
,
module_name
,
result
):
if
sys
.
version_info
[
0
]
>=
3
or
not
hasattr
(
os
,
'fork'
)
or
not
self
.
fork
:
doctest
.
DocTestSuite
(
module_name
).
run
(
result
)
def
run_test
(
result
):
tests
=
doctest
.
DocTestSuite
(
module_name
)
tests
.
run
(
result
)
run_forked_test
(
result
,
run_test
,
self
.
shortDescription
(),
self
.
fork
)
def
run_forked_test
(
result
,
run_func
,
test_name
,
fork
=
True
):
if
sys
.
version_info
[
0
]
>=
3
or
not
hasattr
(
os
,
'fork'
)
or
not
fork
:
run_test
(
result
)
gc
.
collect
()
return
...
...
@@ -604,15 +611,14 @@ class CythonRunTestCase(CythonCompileTestCase):
tests
=
None
try
:
partial_result
=
PartialTestResult
(
result
)
tests
=
doctest
.
DocTestSuite
(
module_name
)
tests
.
run
(
partial_result
)
run_func
(
partial_result
)
gc
.
collect
()
except
Exception
:
if
tests
is
None
:
# importing failed, try to fake a test class
tests
=
_FakeClass
(
failureException
=
sys
.
exc_info
()[
1
],
_shortDescription
=
self
.
shortDescription
()
,
_shortDescription
=
test_name
,
module_name
=
None
)
partial_result
.
addError
(
tests
,
sys
.
exc_info
())
result_code
=
1
...
...
@@ -773,6 +779,7 @@ class CythonPyregrTestCase(CythonRunTestCase):
except
ImportError
:
# Py3k
from
test
import
support
def
run_test
(
result
):
def
run_unittest
(
*
classes
):
return
self
.
_run_unittest
(
result
,
*
classes
)
def
run_doctest
(
module
,
verbosity
=
None
):
...
...
@@ -788,6 +795,8 @@ class CythonPyregrTestCase(CythonRunTestCase):
except
(
unittest
.
SkipTest
,
support
.
ResourceDenied
):
result
.
addSkip
(
self
,
'ok'
)
run_forked_test
(
result
,
run_test
,
self
.
shortDescription
(),
self
.
fork
)
include_debugger
=
sys
.
version_info
[:
2
]
>
(
2
,
5
)
def
collect_unittests
(
path
,
module_prefix
,
suite
,
selectors
):
...
...
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