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
4257453b
Commit
4257453b
authored
May 15, 2008
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more test fixes for Py3
parent
fdcaa814
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
54 additions
and
22 deletions
+54
-22
tests/run/classkwonlyargs.pyx
tests/run/classkwonlyargs.pyx
+9
-1
tests/run/extkwonlyargs.pyx
tests/run/extkwonlyargs.pyx
+4
-0
tests/run/extstarargs.pyx
tests/run/extstarargs.pyx
+12
-8
tests/run/kwonlyargs.pyx
tests/run/kwonlyargs.pyx
+4
-0
tests/run/r_addint.pyx
tests/run/r_addint.pyx
+3
-3
tests/run/r_toofewargs.pyx
tests/run/r_toofewargs.pyx
+4
-0
tests/run/simpcall.pyx
tests/run/simpcall.pyx
+6
-2
tests/run/starargs.pyx
tests/run/starargs.pyx
+12
-8
No files found.
tests/run/classkwonlyargs.pyx
View file @
4257453b
...
...
@@ -49,7 +49,7 @@ __doc__ = u"""
>>> g(1,2, c=1, e=0, f=2, d=11)
>>> g(1,2, c=1, f=2, e=0, x=25)
>>> g(1,2,3)
>>> g(1,2,3)
#doctest: +ELLIPSIS
Traceback (most recent call last):
TypeError: function takes at most 3 positional arguments (4 given)
>>> g(1,2)
...
...
@@ -84,6 +84,14 @@ __doc__ = u"""
TypeError: required keyword argument 'f' is missing
"""
import
sys
,
re
if
sys
.
version_info
[
0
]
>=
3
:
__doc__
=
re
.
sub
(
u"Error: (.*)exactly(.*)"
,
u"Error:
\
\
1at most
\
\
2"
,
__doc__
)
import
sys
,
re
if
sys
.
version_info
[
0
]
>=
3
:
__doc__
=
re
.
sub
(
u"(ELLIPSIS[^>]*Error: )[^
\
n
]*
\
n
"
,
u"
\
\
1...
\
n
"
,
__doc__
,
re
.
M
)
class
Spam
:
def
b
(
self
,
a
,
b
,
c
):
pass
...
...
tests/run/extkwonlyargs.pyx
View file @
4257453b
...
...
@@ -84,6 +84,10 @@ __doc__ = u"""
TypeError: required keyword argument 'f' is missing
"""
import
sys
,
re
if
sys
.
version_info
[
0
]
>=
3
:
__doc__
=
re
.
sub
(
u"Error: (.*)exactly(.*)"
,
u"Error:
\
\
1at most
\
\
2"
,
__doc__
)
cdef
class
Ext
:
def
b
(
self
,
a
,
b
,
c
):
pass
...
...
tests/run/extstarargs.pyx
View file @
4257453b
...
...
@@ -8,7 +8,7 @@ __doc__ = u"""
>>> spam(1,2) #doctest: +ELLIPSIS
Traceback (most recent call last):
TypeError: function takes exactly 3 arguments (2 given)
>>> spam(1,2,3,4)
#doctest: +ELLIPSIS
>>> spam(1,2,3,4)
Traceback (most recent call last):
TypeError: function takes exactly 3 arguments (4 given)
>>> spam(1,2,3, a=1) #doctest: +ELLIPSIS
...
...
@@ -30,7 +30,7 @@ __doc__ = u"""
>>> swallow(1,2,3)
(1, 2, 3, ())
>>> swallow(1,2,3,4)
#doctest: +ELLIPSIS
>>> swallow(1,2,3,4)
Traceback (most recent call last):
TypeError: function takes at most 3 positional arguments (4 given)
>>> swallow(1,2,3, a=1, b=2)
...
...
@@ -55,10 +55,10 @@ __doc__ = u"""
(1,)
>>> onlyt(1,2)
(1, 2)
>>> onlyt(a=1)
#doctest: +ELLIPSIS
>>> onlyt(a=1)
Traceback (most recent call last):
TypeError: 'a' is an invalid keyword argument for this function
>>> onlyt(1, a=2)
#doctest: +ELLIPSIS
>>> onlyt(1, a=2)
Traceback (most recent call last):
TypeError: 'a' is an invalid keyword argument for this function
...
...
@@ -66,13 +66,13 @@ __doc__ = u"""
(('a', 1),)
>>> onlyk(a=1, b=2)
(('a', 1), ('b', 2))
>>> onlyk(1)
#doctest: +ELLIPSIS
>>> onlyk(1)
Traceback (most recent call last):
TypeError: function takes at most 0 positional arguments (1 given)
>>> onlyk(1, 2)
#doctest: +ELLIPSIS
>>> onlyk(1, 2)
Traceback (most recent call last):
TypeError: function takes at most 0 positional arguments (2 given)
>>> onlyk(1, a=1, b=2)
#doctest: +ELLIPSIS
>>> onlyk(1, a=1, b=2)
Traceback (most recent call last):
TypeError: function takes at most 0 positional arguments (1 given)
...
...
@@ -90,7 +90,11 @@ __doc__ = u"""
import
sys
,
re
if
sys
.
version_info
[
0
]
>=
3
:
__doc__
=
re
.
sub
(
u"Error: (.*)"
,
u"Error: ..."
,
__doc__
)
__doc__
=
re
.
sub
(
u"Error: (.*)exactly(.*)"
,
u"Error:
\
\
1at most
\
\
2"
,
__doc__
)
import
sys
,
re
if
sys
.
version_info
[
0
]
>=
3
:
__doc__
=
re
.
sub
(
u"(ELLIPSIS[^>]*Error: )[^
\
n
]*
\
n
"
,
u"
\
\
1...
\
n
"
,
__doc__
,
re
.
M
)
cdef
sorteditems
(
d
):
l
=
list
(
d
.
items
())
...
...
tests/run/kwonlyargs.pyx
View file @
4257453b
...
...
@@ -81,6 +81,10 @@ __doc__ = u"""
TypeError: required keyword argument 'f' is missing
"""
import
sys
,
re
if
sys
.
version_info
[
0
]
>=
3
:
__doc__
=
re
.
sub
(
u"Error: (.*)exactly(.*)"
,
u"Error:
\
\
1at most
\
\
2"
,
__doc__
)
def
b
(
a
,
b
,
c
):
pass
...
...
tests/run/r_addint.pyx
View file @
4257453b
__doc__
=
u"""
>>> def test(a, b):
...
print((a, b, add(a, b)
))
...
return (a, b, add(a, b
))
>>> test(1, 2)
(1, 2, 3)
>>> [
rep
r(f) for f in test(17.3, 88.6) ]
[
17.3, 88.6, 105.9
]
>>> [
st
r(f) for f in test(17.3, 88.6) ]
[
'17.3', '88.6', '105.9'
]
>>> test(u"eggs", u"spam")
(u'eggs', u'spam', u'eggsspam')
"""
...
...
tests/run/r_toofewargs.pyx
View file @
4257453b
...
...
@@ -4,6 +4,10 @@ __doc__ = u"""
TypeError: function takes exactly 3 arguments (0 given)
"""
import
sys
,
re
if
sys
.
version_info
[
0
]
>=
3
:
__doc__
=
re
.
sub
(
u"Error: (.*)exactly(.*)"
,
u"Error:
\
\
1at most
\
\
2"
,
__doc__
)
cdef
class
Spam
:
def
__init__
(
self
,
a
,
b
,
int
c
):
...
...
tests/run/simpcall.pyx
View file @
4257453b
...
...
@@ -4,15 +4,19 @@ __doc__ = u"""
Traceback (most recent call last):
TypeError: an integer is required
>>> fail0(1,2)
>>> fail0(1,2)
#doctest: +ELLIPSIS
Traceback (most recent call last):
TypeError: function takes exactly 2 arguments (0 given)
>>> fail1(1,2)
>>> fail1(1,2)
#doctest: +ELLIPSIS
Traceback (most recent call last):
TypeError: function takes exactly 2 arguments (1 given)
"""
import
sys
,
re
if
sys
.
version_info
[
0
]
>=
3
:
__doc__
=
re
.
sub
(
u"Error: .*exactly.*"
,
u"Error: ..."
,
__doc__
)
import
sys
if
sys
.
version_info
[
0
]
<
3
:
__doc__
=
__doc__
.
replace
(
u" b'"
,
u" '"
)
...
...
tests/run/starargs.pyx
View file @
4257453b
...
...
@@ -4,7 +4,7 @@ __doc__ = u"""
>>> spam(1,2) #doctest: +ELLIPSIS
Traceback (most recent call last):
TypeError: function takes exactly 3 arguments (2 given)
>>> spam(1,2,3,4)
#doctest: +ELLIPSIS
>>> spam(1,2,3,4)
Traceback (most recent call last):
TypeError: function takes exactly 3 arguments (4 given)
>>> spam(1,2,3, a=1) #doctest: +ELLIPSIS
...
...
@@ -26,7 +26,7 @@ __doc__ = u"""
>>> swallow(1,2,3)
(1, 2, 3, ())
>>> swallow(1,2,3,4)
#doctest: +ELLIPSIS
>>> swallow(1,2,3,4)
Traceback (most recent call last):
TypeError: function takes at most 3 positional arguments (4 given)
>>> swallow(1,2,3, a=1, b=2)
...
...
@@ -51,10 +51,10 @@ __doc__ = u"""
(1,)
>>> onlyt(1,2)
(1, 2)
>>> onlyt(a=1)
#doctest: +ELLIPSIS
>>> onlyt(a=1)
Traceback (most recent call last):
TypeError: 'a' is an invalid keyword argument for this function
>>> onlyt(1, a=2)
#doctest: +ELLIPSIS
>>> onlyt(1, a=2)
Traceback (most recent call last):
TypeError: 'a' is an invalid keyword argument for this function
...
...
@@ -62,13 +62,13 @@ __doc__ = u"""
(('a', 1),)
>>> onlyk(a=1, b=2)
(('a', 1), ('b', 2))
>>> onlyk(1)
#doctest: +ELLIPSIS
>>> onlyk(1)
Traceback (most recent call last):
TypeError: function takes at most 0 positional arguments (1 given)
>>> onlyk(1, 2)
#doctest: +ELLIPSIS
>>> onlyk(1, 2)
Traceback (most recent call last):
TypeError: function takes at most 0 positional arguments (2 given)
>>> onlyk(1, a=1, b=2)
#doctest: +ELLIPSIS
>>> onlyk(1, a=1, b=2)
Traceback (most recent call last):
TypeError: function takes at most 0 positional arguments (1 given)
...
...
@@ -86,7 +86,11 @@ __doc__ = u"""
import
sys
,
re
if
sys
.
version_info
[
0
]
>=
3
:
__doc__
=
re
.
sub
(
u"Error: (.*)"
,
u"Error: ..."
,
__doc__
)
__doc__
=
re
.
sub
(
u"Error: (.*)exactly(.*)"
,
u"Error:
\
\
1at most
\
\
2"
,
__doc__
)
import
sys
,
re
if
sys
.
version_info
[
0
]
>=
3
:
__doc__
=
re
.
sub
(
u"(ELLIPSIS[^>]*Error: )[^
\
n
]*
\
n
"
,
u"
\
\
1...
\
n
"
,
__doc__
,
re
.
M
)
cdef
sorteditems
(
d
):
l
=
list
(
d
.
items
())
...
...
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