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
93750dc8
Commit
93750dc8
authored
Oct 27, 2009
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test fixes for Py2.4
parent
0ac24ec1
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
34 additions
and
4 deletions
+34
-4
tests/run/cdivision_CEP_516.pyx
tests/run/cdivision_CEP_516.pyx
+12
-0
tests/run/funcexceptreturn.pyx
tests/run/funcexceptreturn.pyx
+1
-1
tests/run/index.pyx
tests/run/index.pyx
+2
-1
tests/run/profile_test.pyx
tests/run/profile_test.pyx
+7
-0
tests/run/str_encoding_latin1.pyx
tests/run/str_encoding_latin1.pyx
+1
-2
tests/run/tuple.pyx
tests/run/tuple.pyx
+6
-0
tests/run/withstat.pyx
tests/run/withstat.pyx
+5
-0
No files found.
tests/run/cdivision_CEP_516.pyx
View file @
93750dc8
...
...
@@ -76,6 +76,18 @@ Traceback (most recent call last):
OverflowError: value too large to perform division
"""
def
_all
(
seq
):
for
x
in
seq
:
if
not
x
:
return
False
return
True
try
:
all
except
NameError
:
all
=
_all
cimport
cython
@
cython
.
cdivision
(
False
)
...
...
tests/run/funcexceptreturn.pyx
View file @
93750dc8
...
...
@@ -5,7 +5,7 @@ __doc__ = u"""
>>> print(sys.exc_info()[0]) # 0
None
>>> exc = test_c()
>>>
type(exc) is TestException
>>>
isinstance(exc, TestException) or exc
True
>>> print(sys.exc_info()[0]) # test_c()
None
...
...
tests/run/index.pyx
View file @
93750dc8
...
...
@@ -51,7 +51,8 @@ TypeError: 'int' object is unsubscriptable
import
sys
if
sys
.
version_info
[
0
]
>=
3
:
__doc__
=
__doc__
.
replace
(
u'is unsubscriptable'
,
u'is not subscriptable'
)
elif
sys
.
version_info
<
(
2
,
5
):
__doc__
=
__doc__
.
replace
(
u"'int' object is unsubscriptable"
,
u'unsubscriptable object'
)
def
index_tuple
(
tuple
t
,
int
i
):
return
t
[
i
]
...
...
tests/run/profile_test.pyx
View file @
93750dc8
...
...
@@ -23,6 +23,13 @@ __doc__ = u"""
>>> os.unlink(statsfile)
"""
import
sys
if
sys
.
version_info
<
(
2
,
5
):
# disable in earlier versions
__doc__
=
"""
>>> # nothing to test here ...
"""
cimport
cython
def
test_profile
(
long
N
):
...
...
tests/run/str_encoding_latin1.pyx
View file @
93750dc8
...
...
@@ -36,8 +36,7 @@ True
"""
# recoding/escaping is required to properly pass the literals to doctest
).
encode
(
'unicode_escape'
).
decode
(
'ASCII'
)
).
encode
(
'unicode_escape'
).
decode
(
'ASCII'
).
replace
(
u'
\
\
n'
,
u'
\
n
'
)
a
=
'abc'
s
=
'ao'
...
...
tests/run/tuple.pyx
View file @
93750dc8
...
...
@@ -19,6 +19,12 @@ __doc__ = u"""
TypeError: 'NoneType' object is not iterable
"""
import
sys
if
sys
.
version_info
<
(
2
,
5
):
__doc__
=
__doc__
.
replace
(
u"'NoneType' object is not iterable
\
n
>>> tuple_none_list()"
,
u'iteration over non-sequence
\
n
>>> tuple_none_list()'
)
def
f
(
obj1
,
obj2
,
obj3
,
obj4
,
obj5
):
obj1
=
()
return
obj1
...
...
tests/run/withstat.pyx
View file @
93750dc8
...
...
@@ -38,6 +38,11 @@ enter
exit <type 'NoneType'> <type 'NoneType'> <type 'NoneType'>
"""
import
sys
if
sys
.
version_info
<
(
2
,
5
):
__doc__
=
__doc__
.
replace
(
u"exit <type 'type'> <type 'MyException'>"
,
u"exit <type 'classobj'> <type 'instance'>"
)
def
typename
(
t
):
return
u"<type '%s'>"
%
type
(
t
).
__name__
...
...
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