cimport test
authorRobert Bradshaw <robertwb@math.washington.edu>
Thu, 17 Feb 2011 00:53:53 +0000 (16:53 -0800)
committerRobert Bradshaw <robertwb@math.washington.edu>
Thu, 17 Feb 2011 00:53:53 +0000 (16:53 -0800)
runtests.py
tests/run/cimport.srctree [new file with mode: 0644]

index a9f323c060f40db8be7a10ff207eee86234d3fd7..3436d473a081890eeb7e658d963c483afbfd22f6 100644 (file)
@@ -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 (file)
index 0000000..55d8920
--- /dev/null
@@ -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)