From 1c8f1009bbcc12a6e1ca0c108561215f3e1ffda1 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Sat, 10 Aug 2013 12:42:09 +0200 Subject: [PATCH] extend test --- tests/run/cyclic_gc.pyx | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tests/run/cyclic_gc.pyx b/tests/run/cyclic_gc.pyx index c4ada3b..b143f75 100644 --- a/tests/run/cyclic_gc.pyx +++ b/tests/run/cyclic_gc.pyx @@ -23,6 +23,23 @@ cdef class ExtTypeNoGC: @cython.test_assert_path_exists('//CClassDefNode', '//CClassDefNode[@scope]', '//CClassDefNode[@scope.has_cyclic_pyobject_attrs = False]') +@cython.final +cdef class ExtTypeFinalNoGC: + """ + >>> obj = ExtTypeFinalNoGC() + >>> obj = ExtTypeFinalNoGC() + >>> obj = ExtTypeFinalNoGC() + >>> obj = ExtTypeFinalNoGC() + >>> obj = ExtTypeFinalNoGC() + >>> obj = ExtTypeFinalNoGC() + """ + cdef bytes s + + +@cython.test_fail_if_path_exists('//CClassDefNode[@scope.has_cyclic_pyobject_attrs = True]') +@cython.test_assert_path_exists('//CClassDefNode', + '//CClassDefNode[@scope]', + '//CClassDefNode[@scope.has_cyclic_pyobject_attrs = False]') cdef class ExtSubTypeNoGC(ExtTypeNoGC): """ >>> obj = ExtSubTypeNoGC() @@ -50,6 +67,8 @@ cdef class ExtTypePyArgsNoGC: cdef bytes b cdef str s cdef unicode u +# eventually, this should work, too: +# cdef ExtTypeFinalNoGC x @cython.test_fail_if_path_exists('//CClassDefNode[@scope.has_cyclic_pyobject_attrs = True]') -- 2.7.4