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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
1c9b9fba
Commit
1c9b9fba
authored
Mar 09, 2010
by
Craig Citro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes to runtests.py.
parent
f7d30514
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
6 deletions
+13
-6
runtests.py
runtests.py
+13
-6
No files found.
runtests.py
View file @
1c9b9fba
...
@@ -434,9 +434,9 @@ class CythonRunTestCase(CythonCompileTestCase):
...
@@ -434,9 +434,9 @@ class CythonRunTestCase(CythonCompileTestCase):
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
=
None
,
failureException
=
sys
.
exc_info
()[
1
]
,
shortDescription
=
self
.
shortDescription
,
_shortDescription
=
self
.
shortDescription
()
,
**
{
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
output
=
open
(
result_file
,
'wb'
)
output
=
open
(
result_file
,
'wb'
)
...
@@ -451,6 +451,13 @@ class CythonRunTestCase(CythonCompileTestCase):
...
@@ -451,6 +451,13 @@ class CythonRunTestCase(CythonCompileTestCase):
try
:
try
:
cid
,
result_code
=
os
.
waitpid
(
child_id
,
0
)
cid
,
result_code
=
os
.
waitpid
(
child_id
,
0
)
# os.waitpid returns the child's result code in the
# upper byte of result_code, and the signal it was
# killed by in the lower byte
if
result_code
&
255
:
raise
Exception
(
"Tests in module '%s' were unexpectedly killed by signal %d"
%
(
module_name
,
result_code
&
255
))
result_code
=
result_code
>>
8
if
result_code
in
(
0
,
1
):
if
result_code
in
(
0
,
1
):
input
=
open
(
result_file
,
'rb'
)
input
=
open
(
result_file
,
'rb'
)
try
:
try
:
...
@@ -459,7 +466,7 @@ class CythonRunTestCase(CythonCompileTestCase):
...
@@ -459,7 +466,7 @@ class CythonRunTestCase(CythonCompileTestCase):
input
.
close
()
input
.
close
()
if
result_code
:
if
result_code
:
raise
Exception
(
"Tests in module '%s' exited with status %d"
%
raise
Exception
(
"Tests in module '%s' exited with status %d"
%
(
module_name
,
result_code
>>
8
))
(
module_name
,
result_code
))
finally
:
finally
:
try
:
os
.
unlink
(
result_file
)
try
:
os
.
unlink
(
result_file
)
except
:
pass
except
:
pass
...
@@ -491,7 +498,7 @@ class PartialTestResult(_TextTestResult):
...
@@ -491,7 +498,7 @@ class PartialTestResult(_TextTestResult):
if
attr_name
==
'_dt_test'
:
if
attr_name
==
'_dt_test'
:
test_case
.
_dt_test
=
_FakeClass
(
test_case
.
_dt_test
=
_FakeClass
(
name
=
test_case
.
_dt_test
.
name
)
name
=
test_case
.
_dt_test
.
name
)
el
se
:
el
if
attr_name
!=
'_shortDescription'
:
setattr
(
test_case
,
attr_name
,
None
)
setattr
(
test_case
,
attr_name
,
None
)
def
data
(
self
):
def
data
(
self
):
...
@@ -504,7 +511,7 @@ class PartialTestResult(_TextTestResult):
...
@@ -504,7 +511,7 @@ class PartialTestResult(_TextTestResult):
"""Static method for merging the result back into the main
"""Static method for merging the result back into the main
result object.
result object.
"""
"""
errors
,
failure
s
,
tests_run
,
output
=
data
failures
,
error
s
,
tests_run
,
output
=
data
if
output
:
if
output
:
result
.
stream
.
write
(
output
)
result
.
stream
.
write
(
output
)
result
.
errors
.
extend
(
errors
)
result
.
errors
.
extend
(
errors
)
...
...
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