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
Kirill Smelkov
cython
Commits
eb57ef1e
Commit
eb57ef1e
authored
Jan 12, 2019
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Repair some tests after switching to language_level=3str.
parent
3c218baf
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
28 additions
and
11 deletions
+28
-11
tests/run/array_cimport.srctree
tests/run/array_cimport.srctree
+2
-2
tests/run/cimport.srctree
tests/run/cimport.srctree
+3
-3
tests/run/cimport_from_sys_path.srctree
tests/run/cimport_from_sys_path.srctree
+2
-2
tests/run/public_fused_types.srctree
tests/run/public_fused_types.srctree
+3
-3
tests/run/relative_cimport.srctree
tests/run/relative_cimport.srctree
+18
-1
No files found.
tests/run/array_cimport.srctree
View file @
eb57ef1e
...
@@ -32,6 +32,6 @@ from tt cimport Foo
...
@@ -32,6 +32,6 @@ from tt cimport Foo
cdef array a = array('i', [1,2,3])
cdef array a = array('i', [1,2,3])
cdef Foo x
cdef Foo x
print
a.data.as_ints[0]
print
(a.data.as_ints[0])
x = Foo(a)
x = Foo(a)
print
x.obj.data.as_ints[0]
print
(x.obj.data.as_ints[0])
tests/run/cimport.srctree
View file @
eb57ef1e
...
@@ -45,10 +45,10 @@ from other cimport (
...
@@ -45,10 +45,10 @@ from other cimport (
A,
A,
foo,
foo,
)
)
print
A, foo(10
)
print
(A, foo(10)
)
cimport other
cimport other
print
other.A, other.foo(10
)
print
(other.A, other.foo(10)
)
from pkg cimport sub
from pkg cimport sub
cdef sub.my_int a = 100
cdef sub.my_int a = 100
...
...
tests/run/cimport_from_sys_path.srctree
View file @
eb57ef1e
...
@@ -32,7 +32,7 @@ static int foo(int a)
...
@@ -32,7 +32,7 @@ static int foo(int a)
######## a.pyx ########
######## a.pyx ########
from b.other cimport foo
from b.other cimport foo
print
foo(10
)
print
(foo(10)
)
cimport b.other
cimport b.other
print
b.other.foo(10
)
print
(b.other.foo(10)
)
tests/run/public_fused_types.srctree
View file @
eb57ef1e
...
@@ -196,8 +196,8 @@ import a as a_mod
...
@@ -196,8 +196,8 @@ import a as a_mod
def ae(result, expected):
def ae(result, expected):
"assert equals"
"assert equals"
if result != expected:
if result != expected:
print
'result :', result
print
('result :', result)
print
'expected:', expected
print
('expected:', expected)
assert result == expected
assert result == expected
...
@@ -227,7 +227,7 @@ ae(myobj.cpdef_method[cy.int, cy.float](10, 10.0), (10, 10.0))
...
@@ -227,7 +227,7 @@ ae(myobj.cpdef_method[cy.int, cy.float](10, 10.0), (10, 10.0))
d = {'obj': obj, 'myobj': myobj, 'ae': ae}
d = {'obj': obj, 'myobj': myobj, 'ae': ae}
exec
s in d
exec
(s, d)
# Test def methods
# Test def methods
# ae(obj.def_method(12, 14.9), 26)
# ae(obj.def_method(12, 14.9), 26)
...
...
tests/run/relative_cimport.srctree
View file @
eb57ef1e
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
PYTHON setup.py build_ext --inplace
PYTHON setup.py build_ext --inplace
PYTHON -c "from pkg.b import test; assert test() == (1, 2)"
PYTHON -c "from pkg.b import test; assert test() == (1, 2)"
PYTHON -c "from pkg.b_py2 import test; assert test() == (1, 2)"
PYTHON -c "from pkg.sub.c import test; assert test() == (1, 2)"
PYTHON -c "from pkg.sub.c import test; assert test() == (1, 2)"
######## setup.py ########
######## setup.py ########
...
@@ -42,7 +43,23 @@ cdef class test_pxd:
...
@@ -42,7 +43,23 @@ cdef class test_pxd:
from . cimport a
from . cimport a
from .a cimport test_pxd
from .a cimport test_pxd
cimport a as implicitly_relative_a
assert a.test_pxd is test_pxd
def test():
cdef test_pxd obj = test_pxd()
obj.x = 1
obj.y = 2
return (obj.x, obj.y)
######## pkg/b_py2.pyx ########
# cython: language_level=2
from . cimport a
from .a cimport test_pxd
cimport a as implicitly_relative_a # <-- Py2 "feature"
assert a.test_pxd is test_pxd
assert a.test_pxd is test_pxd
assert implicitly_relative_a.test_pxd is test_pxd
assert implicitly_relative_a.test_pxd is test_pxd
...
...
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