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
31f8c53f
Commit
31f8c53f
authored
Nov 03, 2009
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
run gc after running a test, prevent the test runner from dead-locking on broken tests
parent
2a5e66ae
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
runtests.py
runtests.py
+10
-2
No files found.
runtests.py
View file @
31f8c53f
...
...
@@ -3,6 +3,7 @@
import
os
import
sys
import
re
import
gc
import
codecs
import
shutil
import
unittest
...
...
@@ -396,6 +397,7 @@ class CythonRunTestCase(CythonCompileTestCase):
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
)
gc
.
collect
()
return
# fork to make sure we do not keep the tested module loaded
...
...
@@ -410,11 +412,13 @@ class CythonRunTestCase(CythonCompileTestCase):
partial_result
=
PartialTestResult
(
result
)
tests
=
doctest
.
DocTestSuite
(
module_name
)
tests
.
run
(
partial_result
)
gc
.
collect
()
except
Exception
:
if
tests
is
None
:
# importing failed, try to fake a test class
tests
=
_FakeClass
(
failureException
=
None
,
shortDescription
=
self
.
shortDescription
,
**
{
module_name
:
None
})
partial_result
.
addError
(
tests
,
sys
.
exc_info
())
result_code
=
1
...
...
@@ -424,9 +428,13 @@ class CythonRunTestCase(CythonCompileTestCase):
except
:
pass
os
.
_exit
(
result_code
)
cid
,
result_code
=
os
.
waitpid
(
child_id
,
0
)
if
result_code
in
(
0
,
1
):
input
=
os
.
fdopen
(
input
,
'rb'
)
try
:
PartialTestResult
.
join_results
(
result
,
pickle
.
load
(
input
))
cid
,
result_code
=
os
.
waitpid
(
child_id
,
0
)
finally
:
input
.
close
()
if
result_code
:
raise
Exception
(
"Tests in module '%s' exited with status %d"
%
(
module_name
,
result_code
>>
8
))
...
...
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