From: Robert Bradshaw Date: Thu, 17 Feb 2011 00:53:53 +0000 (-0800) Subject: cimport test X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=d19977246b9967ff2c07da7c2010c4ffc50e050f;p=cython.git cimport test --- diff --git a/runtests.py b/runtests.py index a9f323c0..3436d473 100644 --- a/runtests.py +++ b/runtests.py @@ -194,7 +194,7 @@ class TestBuilder(object): filenames = os.listdir(path) filenames.sort() for filename in filenames: - if context == "build" and filename.endswith(".srctree"): + if filename.endswith(".srctree"): if not [ 1 for match in self.selectors if match(filename) ]: continue if self.exclude_selectors: diff --git a/tests/run/cimport.srctree b/tests/run/cimport.srctree new file mode 100644 index 00000000..55d8920e --- /dev/null +++ b/tests/run/cimport.srctree @@ -0,0 +1,35 @@ +PYTHON setup.py build_ext --inplace +PYTHON -c "import a" + +######## setup.py ######## + + +from Cython.Build import cythonize +from distutils.core import setup + +setup( + ext_modules = cythonize("*.pyx"), +) + +######## other.pxd ######## + +cdef class A: + pass + +cdef int foo(int) + +######## other.pyx ######## + +cdef class A: + pass + +cdef int foo(int a): + return a**2 + +######## a.pyx ######## + +from other cimport A, foo +print A, foo(10) + +cimport other +print other.A, other.foo(10)