test case for #454
authorStefan Behnel <scoder@users.berlios.de>
Wed, 11 Nov 2009 07:34:40 +0000 (08:34 +0100)
committerStefan Behnel <scoder@users.berlios.de>
Wed, 11 Nov 2009 07:34:40 +0000 (08:34 +0100)
tests/bugs.txt
tests/run/tp_new_T454.pyx [new file with mode: 0644]

index 23dca0c7b4b73e717d6a2e9fbd763bd074fc219f..49ba73ebdbf3cfab7b3a552dd2be83377b2ae9ff 100644 (file)
@@ -1,4 +1,4 @@
-# This file contains tests corresponding to of unresolved bugs, 
+# This file contains tests corresponding to unresolved bugs, 
 # which will be skipped in the normal testing run. 
 
 methodmangling_T5
@@ -6,3 +6,4 @@ class_attribute_init_values_T18
 numpy_ValueError_T172
 unsignedbehaviour_T184
 missing_baseclass_in_predecl_T262
+tp_new_T454
diff --git a/tests/run/tp_new_T454.pyx b/tests/run/tp_new_T454.pyx
new file mode 100644 (file)
index 0000000..2482f61
--- /dev/null
@@ -0,0 +1,16 @@
+
+cimport cython
+
+cdef class TypeWithFactory:
+    @cython.test_assert_path_exists('//PythonCapiCallNode')
+    @cython.test_fail_if_path_exists('//SimpleCallNode/AttributeNode')
+    @classmethod
+    def new(cls):
+        return cls.__new__(cls)
+
+def make_new_factory():
+    """
+    >>> isinstance(make_new_factory(), TypeWithFactory)
+    True
+    """
+    return TypeWithFactory.new()