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
f81c75f4
Commit
f81c75f4
authored
Jan 14, 2010
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Py2/3 portability fixes in test runner
parent
77bf40fa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
21 deletions
+27
-21
runtests.py
runtests.py
+27
-21
No files found.
runtests.py
View file @
f81c75f4
...
@@ -408,26 +408,27 @@ class CythonRunTestCase(CythonCompileTestCase):
...
@@ -408,26 +408,27 @@ class CythonRunTestCase(CythonCompileTestCase):
if
not
child_id
:
if
not
child_id
:
result_code
=
0
result_code
=
0
try
:
try
:
output
=
os
.
fdopen
(
result_handle
,
'wb'
)
tests
=
None
try
:
try
:
partial_result
=
PartialTestResult
(
result
)
output
=
os
.
fdopen
(
result_handle
,
'wb'
)
tests
=
doctest
.
DocTestSuite
(
module_name
)
tests
=
None
tests
.
run
(
partial_result
)
try
:
gc
.
collect
()
partial_result
=
PartialTestResult
(
result
)
except
Exception
:
tests
=
doctest
.
DocTestSuite
(
module_name
)
if
tests
is
None
:
tests
.
run
(
partial_result
)
# importing failed, try to fake a test class
gc
.
collect
()
tests
=
_FakeClass
(
except
Exception
:
failureException
=
None
,
if
tests
is
None
:
shortDescription
=
self
.
shortDescription
,
# importing failed, try to fake a test class
**
{
module_name
:
None
})
tests
=
_FakeClass
(
partial_result
.
addError
(
tests
,
sys
.
exc_info
())
failureException
=
None
,
result_code
=
1
shortDescription
=
self
.
shortDescription
,
pickle
.
dump
(
partial_result
.
data
(),
output
)
**
{
module_name
:
None
})
except
:
partial_result
.
addError
(
tests
,
sys
.
exc_info
())
import
traceback
result_code
=
1
traceback
.
print_exc
()
pickle
.
dump
(
partial_result
.
data
(),
output
)
except
:
import
traceback
traceback
.
print_exc
()
finally
:
finally
:
try
:
output
.
close
()
try
:
output
.
close
()
except
:
pass
except
:
pass
...
@@ -741,8 +742,13 @@ if __name__ == '__main__':
...
@@ -741,8 +742,13 @@ if __name__ == '__main__':
'''
)
'''
)
sys
.
path
.
insert
(
0
,
cy3_dir
)
sys
.
path
.
insert
(
0
,
cy3_dir
)
elif
sys
.
version_info
[
0
]
>=
3
:
elif
sys
.
version_info
[
0
]
>=
3
:
# make sure we do not import (or run) Cython itself
# make sure we do not import (or run) Cython itself (unless
options
.
with_cython
=
False
# 2to3 was already run)
cy3_dir
=
os
.
path
.
join
(
WORKDIR
,
'Cy3'
)
if
os
.
path
.
isdir
(
cy3_dir
):
sys
.
path
.
insert
(
0
,
cy3_dir
)
else
:
options
.
with_cython
=
False
options
.
doctests
=
False
options
.
doctests
=
False
options
.
unittests
=
False
options
.
unittests
=
False
options
.
pyregr
=
False
options
.
pyregr
=
False
...
...
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