From 93242f95f1f0c3a0fe987973d4e3407df66dae7f Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Wed, 11 Nov 2009 08:34:40 +0100 Subject: [PATCH] test case for #454 --- tests/bugs.txt | 3 ++- tests/run/tp_new_T454.pyx | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 tests/run/tp_new_T454.pyx 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() -- 2.26.2