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):
...
@@ -588,8 +588,15 @@ class CythonRunTestCase(CythonCompileTestCase):
self
.
run_doctests
(
self
.
module
,
result
)
self
.
run_doctests
(
self
.
module
,
result
)
def
run_doctests
(
self
,
module_name
,
result
):
def
run_doctests
(
self
,
module_name
,
result
):
if
sys
.
version_info
[
0
]
>=
3
or
not
hasattr
(
os
,
'fork'
)
or
not
self
.
fork
:
def
run_test
(
result
):
doctest
.
DocTestSuite
(
module_name
).
run
(
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
()
gc
.
collect
()
return
return
...
@@ -604,15 +611,14 @@ class CythonRunTestCase(CythonCompileTestCase):
...
@@ -604,15 +611,14 @@ class CythonRunTestCase(CythonCompileTestCase):
tests
=
None
tests
=
None
try
:
try
:
partial_result
=
PartialTestResult
(
result
)
partial_result
=
PartialTestResult
(
result
)
tests
=
doctest
.
DocTestSuite
(
module_name
)
run_func
(
partial_result
)
tests
.
run
(
partial_result
)
gc
.
collect
()
gc
.
collect
()
except
Exception
:
except
Exception
:
if
tests
is
None
:
if
tests
is
None
:
# importing failed, try to fake a test class
# importing failed, try to fake a test class
tests
=
_FakeClass
(
tests
=
_FakeClass
(
failureException
=
sys
.
exc_info
()[
1
],
failureException
=
sys
.
exc_info
()[
1
],
_shortDescription
=
self
.
shortDescription
()
,
_shortDescription
=
test_name
,
module_name
=
None
)
module_name
=
None
)
partial_result
.
addError
(
tests
,
sys
.
exc_info
())
partial_result
.
addError
(
tests
,
sys
.
exc_info
())
result_code
=
1
result_code
=
1
...
@@ -773,6 +779,7 @@ class CythonPyregrTestCase(CythonRunTestCase):
...
@@ -773,6 +779,7 @@ class CythonPyregrTestCase(CythonRunTestCase):
except
ImportError
:
# Py3k
except
ImportError
:
# Py3k
from
test
import
support
from
test
import
support
def
run_test
(
result
):
def
run_unittest
(
*
classes
):
def
run_unittest
(
*
classes
):
return
self
.
_run_unittest
(
result
,
*
classes
)
return
self
.
_run_unittest
(
result
,
*
classes
)
def
run_doctest
(
module
,
verbosity
=
None
):
def
run_doctest
(
module
,
verbosity
=
None
):
...
@@ -788,6 +795,8 @@ class CythonPyregrTestCase(CythonRunTestCase):
...
@@ -788,6 +795,8 @@ class CythonPyregrTestCase(CythonRunTestCase):
except
(
unittest
.
SkipTest
,
support
.
ResourceDenied
):
except
(
unittest
.
SkipTest
,
support
.
ResourceDenied
):
result
.
addSkip
(
self
,
'ok'
)
result
.
addSkip
(
self
,
'ok'
)
run_forked_test
(
result
,
run_test
,
self
.
shortDescription
(),
self
.
fork
)
include_debugger
=
sys
.
version_info
[:
2
]
>
(
2
,
5
)
include_debugger
=
sys
.
version_info
[:
2
]
>
(
2
,
5
)
def
collect_unittests
(
path
,
module_prefix
,
suite
,
selectors
):
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