From cfdfe4fa183ef7d94a9e7d41890161d0ce151af2 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Thu, 1 May 2008 08:18:39 +0200 Subject: [PATCH] enabled test case --HG-- rename : tests/broken/getattr3call.pyx => tests/run/getattr3call.pyx --- tests/broken/getattr3call.pyx | 2 -- tests/run/getattr3call.pyx | 31 +++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 2 deletions(-) delete mode 100644 tests/broken/getattr3call.pyx create mode 100644 tests/run/getattr3call.pyx diff --git a/tests/broken/getattr3call.pyx b/tests/broken/getattr3call.pyx deleted file mode 100644 index 015f4582..00000000 --- a/tests/broken/getattr3call.pyx +++ /dev/null @@ -1,2 +0,0 @@ -cdef int f(a, b, c) except -1: - d = getattr3(a, b, c) diff --git a/tests/run/getattr3call.pyx b/tests/run/getattr3call.pyx new file mode 100644 index 00000000..64c847bf --- /dev/null +++ b/tests/run/getattr3call.pyx @@ -0,0 +1,31 @@ +__doc__ = """ + >>> class test(object): a = 1 + >>> t = test() + + >>> f(t, 'a') + 1 + >>> f(t, 'b') + Traceback (most recent call last): + AttributeError: 'test' object has no attribute 'b' + + >>> g(t, 'a', 2) + 1 + >>> g(t, 'b', 2) + 2 +""" + +BROKEN = """ + >>> h(t, 'a', 2) + 1 + >>> h(t, 'b', 2) + 2 +""" + +def f(a, b): + return getattr(a, b) + +def g(a, b, c): + return getattr3(a, b, c) + +#def h(a, b, c): +# return getattr(a, b, c) -- 2.26.2