enable extended test case for ticket #593
authorStefan Behnel <scoder@users.berlios.de>
Wed, 29 Dec 2010 22:53:29 +0000 (23:53 +0100)
committerStefan Behnel <scoder@users.berlios.de>
Wed, 29 Dec 2010 22:53:29 +0000 (23:53 +0100)
tests/bugs.txt
tests/run/decorators_T593.pyx

index c97798ef546fffa971a82bca8aeffc10bad24a2b..5f0b87157d9bd9d179d39a3db04c8b14e3a287ac 100644 (file)
@@ -18,7 +18,6 @@ ipow_crash_T562
 pure_mode_cmethod_inheritance_T583
 genexpr_iterable_lookup_T600
 for_from_pyvar_loop_T601
-decorators_T593
 
 # CPython regression tests that don't current work:
 pyregr.test_threadsignals
index 39edde60b3f25900a3c6bf1a6432b9d6307f1875..71737d01fde78d921bdccb279db018e1ed2a8946 100644 (file)
@@ -24,6 +24,47 @@ def testclass(klass):
 class Foo:
     pass
 
+def class_in_closure(x):
+    """
+    >>> C1, c0 = class_in_closure(5)
+    >>> C1().smeth1()
+    (5, ())
+    >>> C1.smeth1(1,2)
+    (5, (1, 2))
+    >>> C1.smeth1()
+    (5, ())
+    >>> c0.smeth0()
+    1
+    >>> c0.__class__.smeth0()
+    1
+    """
+    class ClosureClass1(object):
+        @staticmethod
+        def smeth1(*args):
+            return x, args
+
+    class ClosureClass0(object):
+        @staticmethod
+        def smeth0():
+            return 1
+
+    return ClosureClass1, ClosureClass0()
+
+def class_not_in_closure():
+    """
+    >>> c = class_not_in_closure()
+    >>> c.smeth0()
+    1
+    >>> c.__class__.smeth0()
+    1
+    """
+    class ClosureClass0(object):
+        @staticmethod
+        def smeth0():
+            return 1
+
+    return ClosureClass0()
+
 class ODict(dict):
    def __init__(self):
        dict.__init__(self)