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
Boxiang Sun
cython
Commits
bd212e78
Commit
bd212e78
authored
May 23, 2014
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add a dedicated test for .pxd overrides in pure mode
parent
e122a152
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
64 additions
and
0 deletions
+64
-0
tests/run/pure_pxd.srctree
tests/run/pure_pxd.srctree
+64
-0
No files found.
tests/run/pure_pxd.srctree
0 → 100644
View file @
bd212e78
PYTHON setup.py build_ext --inplace
PYTHON -c "import a; a.test()"
######## setup.py ########
from Cython.Build.Dependencies import cythonize
from distutils.core import setup
setup(
ext_modules=cythonize("a.py"),
)
######## a.py ########
class ExtTypePass(object):
pass
class ExtTypePxdDocstring(object):
pass
class ExtTypeDocstring(object):
"""huhu!""" # this should override the .pxd docstring
class ExtTypeAttributes(object):
"""
>>> x = ExtTypeAttributes()
>>> x.b
[1, 2, 3]
"""
def __init__(self):
self.a = 123
self.b = [1, 2, 3]
def test():
import os.path
assert 'a.py' not in os.path.basename(__file__), __file__
assert not ExtTypePass().__doc__, ExtTypePass().__doc__
assert ExtTypeDocstring().__doc__ == "huhu!", ExtTypeDocstring().__doc__
assert ExtTypePxdDocstring().__doc__ == "ho, ho, ho!", ExtTypePxdDocstring().__doc__
import doctest
doctest.testmod(verbose=True)
######## a.pxd ########
cdef class ExtTypePass:
pass
cdef class ExtTypePxdDocstring:
"""ho, ho, ho!"""
cdef class ExtTypeAttributes:
cdef int a
cdef readonly list b
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