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
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
Hide 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
cdef array a = array('i', [1,2,3])
cdef Foo x
print
a.data.as_ints[0]
print
(a.data.as_ints[0])
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,12 +45,12 @@ from other cimport (
A,
foo,
)
print
A, foo(10
)
print
(A, foo(10)
)
cimport other
print
other.A, other.foo(10
)
print
(other.A, other.foo(10)
)
from pkg cimport sub
cdef sub.my_int a = 100
from pkg.subpkg cimport submod
\ No newline at end of file
from pkg.subpkg cimport submod
tests/run/cimport_from_sys_path.srctree
View file @
eb57ef1e
...
...
@@ -32,7 +32,7 @@ static int foo(int a)
######## a.pyx ########
from b.other cimport foo
print
foo(10
)
print
(foo(10)
)
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
def ae(result, expected):
"assert equals"
if result != expected:
print
'result :', result
print
'expected:', expected
print
('result :', result)
print
('expected:', expected)
assert result == expected
...
...
@@ -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}
exec
s in d
exec
(s, d)
# Test def methods
# ae(obj.def_method(12, 14.9), 26)
...
...
tests/run/relative_cimport.srctree
View file @
eb57ef1e
...
...
@@ -3,6 +3,7 @@
PYTHON setup.py build_ext --inplace
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)"
######## setup.py ########
...
...
@@ -42,7 +43,23 @@ cdef class test_pxd:
from . cimport a
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 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