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
Xavier Thompson
cython
Commits
481d7bec
Commit
481d7bec
authored
16 years ago
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lots of test fixes for Py3
parent
315de331
3.0a6-cypclass
3.0a5-cypclass_pyobject_virtual
3.0a5-cypclass_virtual
3.0a6-cypclass_attribute_lock
3.0a6-cypclass_attribute_lock_nonrecursive_rw
3.0a6-cypclass_consume
3.0a6-cypclass_frozen
3.0a6-cypclass_lock
3.0a6-cypclass_recover_consume
cypclass_pyobject
cypclass_pyobject_virtual
cypclass_virtual
master
nogil_cypclass_acthon_on_rc8v3
3.0a6
3.0a5
3.0a4
3.0a3
3.0a2
3.0a1
0.29.21
0.29.20
0.29.19
0.29.18
0.29.17
0.29.16
0.29.15
0.29.14
0.29.13
0.29.12
0.29.11
0.29.10
0.29.9
0.29.8
0.29.7
0.29.6
0.29.5
0.29.4
0.29.3
0.29.2
0.29.1
0.29
0.29rc2
0.29rc1
0.29b1
0.28.6
0.28.5
0.28.4
0.28.3
0.28.2
0.28.1
0.28
0.28rc1
0.28b2
0.28b1
0.27.3
0.27.2
0.27.1
0.27.1b1
0.27
0.27rc1
0.27b1
0.27a1
0.26.1
0.26.1rc1
0.26
0.26rc2
0.26rc1
0.26rc0
0.26b2
0.26b1
0.26b0
0.26.alpha0
0.25.2
0.25.2rc0
0.25.2b1
0.25.1
0.25.1b1
0.25.1b0
0.25
0.25b2
0.25b1
0.25b0
0.25a0
0.24.1
0.24
0.24b0
0.24a0
0.23.5
0.23.4
0.23.3
0.23.2
0.23.1
0.23
0.23.beta1
0.23b2
0.22.1
0.22.1rc1
0.22
0.22.beta0
0.22.alpha0
0.21.2
0.21.1
0.21
0.21rc1
0.21b2
0.21b1
0.21a1
0.20.2
0.20.2b1
0.20.1
0.20.1rc1
0.20
0.20rc1
0.20b2
0.20b1
0.19.2
0.19.1
0.19
0.19rc1
0.19b2
0.19b1
0.18
0.18rc1
0.18b1
0.17.4
0.17.3
0.17.2
0.17.1
0.17
0.17.beta1
0.17b4
0.17b3
0.17b2
0.16
0.16rc2
0.16rc1
0.16rc0
0.16.beta0
0.15.1
0.15
0.15rc2
0.15rc1
0.15rc0
0.14.1
0.14.1rc3
0.14.1rc2
0.14.1rc1
0.14.1rc0
0.14
0.14.rc0
0.14.beta2
0.14.beta1
0.14.beta0
0.14.alpha0
0.13
0.13.beta1
0.13.beta0
0.12.1
0.12
0.12.rc0
0.12.alpha0
0.11.3
0.11.3.rc0
0.11.2
0.11.2.rc1
0.11.1
0.11.1.beta
0.11.1.alpha
0.11.rc
0.11-beta
0.10.3
0.10.2
0.10.1
0.10
0.9.9.2.beta
0.9.8.1
0.9.8
0.9.8rc1
snippets_article
nogil_cypclass_rc8
nogil_cypclass_lock_on_rc8v3
cythonplus-0.2
cythonplus-0.1
cypclass_pyobject_before_mro_rebase_12_06_2020
No related merge requests found
Changes
15
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
66 additions
and
41 deletions
+66
-41
tests/run/r_barbieri1.pyx
tests/run/r_barbieri1.pyx
+4
-0
tests/run/r_bowden1.pyx
tests/run/r_bowden1.pyx
+2
-2
tests/run/r_docstrings.pyx
tests/run/r_docstrings.pyx
+18
-14
tests/run/r_extcomplex2.pyx
tests/run/r_extcomplex2.pyx
+2
-2
tests/run/r_huss3.pyx
tests/run/r_huss3.pyx
+4
-0
tests/run/r_mitch_chapman_2.pyx
tests/run/r_mitch_chapman_2.pyx
+8
-4
tests/run/r_primes.pyx
tests/run/r_primes.pyx
+1
-1
tests/run/r_pythonapi.pyx
tests/run/r_pythonapi.pyx
+6
-2
tests/run/r_spamtype.pyx
tests/run/r_spamtype.pyx
+2
-2
tests/run/r_vree_1.pyx
tests/run/r_vree_1.pyx
+1
-1
tests/run/simpcall.pyx
tests/run/simpcall.pyx
+5
-1
tests/run/slice3.pyx
tests/run/slice3.pyx
+3
-3
tests/run/starargs.pyx
tests/run/starargs.pyx
+1
-1
tests/run/strconstinclass.pyx
tests/run/strconstinclass.pyx
+1
-1
tests/run/strfunction.pyx
tests/run/strfunction.pyx
+8
-7
No files found.
tests/run/r_barbieri1.pyx
View file @
481d7bec
...
...
@@ -6,6 +6,10 @@ __doc__ = u"""
Exception: crash-me
"""
import
sys
if
sys
.
version_info
[
0
]
>=
3
:
__doc__
=
__doc__
.
replace
(
u"Exception, e'"
,
u"Exception as e"
)
cdef
class
A
:
def
__cinit__
(
self
):
raise
Exception
(
"crash-me"
)
...
...
This diff is collapsed.
Click to expand it.
tests/run/r_bowden1.pyx
View file @
481d7bec
__doc__
=
u"""
>>>
print
f(100)
>>> f(100)
101
>>>
print
g(3000000000)
>>> g(3000000000)
3000000001
"""
...
...
This diff is collapsed.
Click to expand it.
tests/run/r_docstrings.pyx
View file @
481d7bec
__doc__
=
u"""
>>> f.__doc__
'This is a function docstring.'
u
'This is a function docstring.'
>>> C.__doc__
'This is a class docstring.'
u
'This is a class docstring.'
>>> CS.__doc__
'This is a subclass docstring.'
>>> print
CSS.__doc__
u
'This is a subclass docstring.'
>>> print
(CSS.__doc__)
None
>>> T.__doc__
'This is an extension type docstring.'
u
'This is an extension type docstring.'
>>> TS.__doc__
'This is an extension subtype docstring.'
u
'This is an extension subtype docstring.'
>>> TSS.__doc__
Compare with standard Python:
...
...
@@ -20,7 +20,7 @@ Compare with standard Python:
>>> def f():
... 'This is a function docstring.'
>>> f.__doc__
'This is a function docstring.'
u
'This is a function docstring.'
>>> class C:
... 'This is a class docstring.'
...
...
@@ -30,29 +30,33 @@ Compare with standard Python:
... pass
>>> C.__doc__
'This is a class docstring.'
u
'This is a class docstring.'
>>> CS.__doc__
'This is a subclass docstring.'
u
'This is a subclass docstring.'
>>> CSS.__doc__
"""
import
sys
if
sys
.
version_info
[
0
]
>=
3
:
__doc__
=
__doc__
.
replace
(
u" u'"
,
u" '"
)
def
f
():
"This is a function docstring."
u
"This is a function docstring."
class
C
:
"This is a class docstring."
u
"This is a class docstring."
class
CS
(
C
):
"This is a subclass docstring."
u
"This is a subclass docstring."
class
CSS
(
CS
):
pass
cdef
class
T
:
"This is an extension type docstring."
u
"This is an extension type docstring."
cdef
class
TS
(
T
):
"This is an extension subtype docstring."
u
"This is an extension subtype docstring."
cdef
class
TSS
(
TS
):
pass
This diff is collapsed.
Click to expand it.
tests/run/r_extcomplex2.pyx
View file @
481d7bec
__doc__
=
u"""
>>> c = eggs()
>>>
print "eggs returned:",
c
eggs returned:
(17+42j)
>>> c
(17+42j)
>>> spam(c)
Real: 17.0
Imag: 42.0
...
...
This diff is collapsed.
Click to expand it.
tests/run/r_huss3.pyx
View file @
481d7bec
...
...
@@ -10,6 +10,10 @@ ValueError:
... print "%s: %s" % (e.__class__.__name__, e)
"""
import
sys
if
sys
.
version_info
[
0
]
>=
3
:
__doc__
=
__doc__
.
replace
(
u"Exception, e'"
,
u"Exception as e"
)
def
bar
():
try
:
raise
TypeError
...
...
This diff is collapsed.
Click to expand it.
tests/run/r_mitch_chapman_2.pyx
View file @
481d7bec
__doc__
=
u"""
>>> boolExpressionsFail()
'Not 2b'
u
'Not 2b'
"""
import
sys
if
sys
.
version_info
[
0
]
>=
3
:
__doc__
=
__doc__
.
replace
(
u" u'"
,
u" '"
)
def
boolExpressionsFail
():
dict
=
{
1
:
1
}
if
not
dict
.
has_key
(
"2b"
)
:
return
"Not 2b"
if
not
"2b"
in
dict
:
return
u
"Not 2b"
else
:
return
"2b?"
return
u
"2b?"
This diff is collapsed.
Click to expand it.
tests/run/r_primes.pyx
View file @
481d7bec
__doc__
=
u"""
>>> pri
nt pri
mes(20)
>>> primes(20)
[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71]
"""
...
...
This diff is collapsed.
Click to expand it.
tests/run/r_pythonapi.pyx
View file @
481d7bec
__doc__
=
u"""
>>> x = spam()
>>> print
repr(x
)
'Ftang
\
\
x00Ftang!'
>>> print
(repr(x)
)
b
'Ftang
\
\
x00Ftang!'
"""
import
sys
if
sys
.
version_info
[
0
]
<
3
:
__doc__
=
__doc__
.
replace
(
u" b'"
,
u" '"
)
cdef
extern
from
"string.h"
:
void
memcpy
(
char
*
d
,
char
*
s
,
int
n
)
...
...
This diff is collapsed.
Click to expand it.
tests/run/r_spamtype.pyx
View file @
481d7bec
__doc__
=
u"""
>>> s = Spam()
>>>
print
s.get_tons()
>>> s.get_tons()
17
>>> s.set_tons(42)
>>>
print
s.get_tons()
>>> s.get_tons()
42
>>> s = None
42 tons of spam is history.
...
...
This diff is collapsed.
Click to expand it.
tests/run/r_vree_1.pyx
View file @
481d7bec
__doc__
=
u"""
__doc__
=
"""# disabled in Py3
>>> test(0)
0L
>>> test(1)
...
...
This diff is collapsed.
Click to expand it.
tests/run/simpcall.pyx
View file @
481d7bec
__doc__
=
u"""
>>> z(1,9.2,'test')
>>> z(1,9.2,
b
'test')
>>> failtype()
Traceback (most recent call last):
TypeError: an integer is required
...
...
@@ -13,6 +13,10 @@ __doc__ = u"""
TypeError: function takes exactly 2 arguments (1 given)
"""
import
sys
if
sys
.
version_info
[
0
]
<
3
:
__doc__
=
__doc__
.
replace
(
u" b'"
,
u" '"
)
def
f
(
x
,
y
):
x
=
y
...
...
This diff is collapsed.
Click to expand it.
tests/run/slice3.pyx
View file @
481d7bec
__doc__
=
u"""
>>> class Test(object):
... def __setitem__(self, key, value):
... print
key, value
... print
((key, value))
... def __getitem__(self, key):
... print
key
... print
(key)
... return self
>>> ellipsis(Test())
...
...
@@ -23,7 +23,7 @@ __doc__ = u"""
slice(1, 2, 3)
>>> set(Test(), -11)
slice(1, 2, 3) -11
(slice(1, 2, 3), -11)
"""
def
ellipsis
(
o
):
...
...
This diff is collapsed.
Click to expand it.
tests/run/starargs.pyx
View file @
481d7bec
...
...
@@ -85,7 +85,7 @@ __doc__ = u"""
"""
cdef
sorteditems
(
d
):
l
=
d
.
items
(
)
l
=
list
(
d
.
items
()
)
l
.
sort
()
return
tuple
(
l
)
...
...
This diff is collapsed.
Click to expand it.
tests/run/strconstinclass.pyx
View file @
481d7bec
__doc__
=
u"""
>>> c = C()
>>> print
c.x
>>> print
(c.x)
foo
"""
...
...
This diff is collapsed.
Click to expand it.
tests/run/strfunction.pyx
View file @
481d7bec
__doc__
=
u"""
>>> s('test')
'test'
>>> s('test'
, **encoding
)
b
'test'
>>> z
'test'
b
'test'
>>> c('testing')
'testing'
b
'testing'
>>> sub('testing a subtype')
'testing a subtype'
>>> subs('testing a subtype')
'testing a subtype'
b
'testing a subtype'
>>> subs('testing a subtype'
, **encoding
)
b
'testing a subtype'
# >>> csub('testing a subtype')
# 'testing a subtype'
...
...
@@ -21,6 +21,7 @@ if sys.version_info[0] >= 3:
encoding
=
{
'encoding'
:
'ASCII'
}
else
:
encoding
=
{}
__doc__
=
__doc__
.
replace
(
u" b'"
,
u" '"
)
s
=
str
z
=
str
(
'test'
,
**
encoding
)
...
...
This diff is collapsed.
Click to expand it.
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