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
757c0b5e
Commit
757c0b5e
authored
Oct 10, 2009
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
disable forked testing in Py3, doesn't currently work due to stdlib differences
parent
af6425f6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
3 deletions
+27
-3
runtests.py
runtests.py
+27
-3
No files found.
runtests.py
View file @
757c0b5e
...
...
@@ -383,7 +383,7 @@ class CythonRunTestCase(CythonCompileTestCase):
pass
def
run_doctests
(
self
,
module_name
,
result
):
if
not
hasattr
(
os
,
'fork'
):
if
sys
.
version_info
[
0
]
>=
3
or
not
hasattr
(
os
,
'fork'
):
doctest
.
DocTestSuite
(
module_name
).
run
(
result
)
return
...
...
@@ -394,11 +394,18 @@ class CythonRunTestCase(CythonCompileTestCase):
result_code
=
0
try
:
output
=
os
.
fdopen
(
output
,
'wb'
)
tests
=
None
try
:
partial_result
=
PartialTestResult
(
result
)
doctest
.
DocTestSuite
(
module_name
).
run
(
partial_result
)
tests
=
doctest
.
DocTestSuite
(
module_name
)
tests
.
run
(
partial_result
)
except
Exception
:
partial_result
.
addError
(
module_name
,
sys
.
exc_info
())
if
tests
is
None
:
# importing failed, try to fake a test class
tests
=
_FakeClass
(
failureException
=
None
,
**
{
module_name
:
None
})
partial_result
.
addError
(
tests
,
sys
.
exc_info
())
result_code
=
1
pickle
.
dump
(
partial_result
.
data
(),
output
)
finally
:
...
...
@@ -414,13 +421,30 @@ class CythonRunTestCase(CythonCompileTestCase):
(
module_name
,
result_code
>>
8
))
is_private_field
=
re
.
compile
(
'^_[^_]'
).
match
class
_FakeClass
(
object
):
def
__init__
(
self
,
**
kwargs
):
self
.
__dict__
.
update
(
kwargs
)
class
PartialTestResult
(
unittest
.
_TextTestResult
):
def
__init__
(
self
,
base_result
):
unittest
.
_TextTestResult
.
__init__
(
self
,
self
.
_StringIO
(),
True
,
base_result
.
dots
+
base_result
.
showAll
*
2
)
def
strip_error_results
(
self
,
results
):
for
test_case
,
error
in
results
:
for
attr_name
in
filter
(
is_private_field
,
dir
(
test_case
)):
if
attr_name
==
'_dt_test'
:
test_case
.
_dt_test
=
_FakeClass
(
name
=
test_case
.
_dt_test
.
name
)
else
:
setattr
(
test_case
,
attr_name
,
None
)
def
data
(
self
):
self
.
strip_error_results
(
self
.
failures
)
self
.
strip_error_results
(
self
.
errors
)
return
(
self
.
failures
,
self
.
errors
,
self
.
testsRun
,
self
.
stream
.
getvalue
())
...
...
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