From: Stefan Behnel Date: Wed, 11 Nov 2009 07:34:40 +0000 (+0100) Subject: test case for #454 X-Git-Tag: 0.12.rc0~1^2~1 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=93242f95f1f0c3a0fe987973d4e3407df66dae7f;p=cython.git test case for #454 --- diff --git a/tests/bugs.txt b/tests/bugs.txt index 23dca0c7..49ba73eb 100644 --- a/tests/bugs.txt +++ b/tests/bugs.txt @@ -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 index 00000000..2482f612 --- /dev/null +++ b/tests/run/tp_new_T454.pyx @@ -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()