test for ticket #536
authorStefan Behnel <scoder@users.berlios.de>
Tue, 1 Jun 2010 06:36:18 +0000 (08:36 +0200)
committerStefan Behnel <scoder@users.berlios.de>
Tue, 1 Jun 2010 06:36:18 +0000 (08:36 +0200)
tests/bugs.txt
tests/run/with_statement_module_level_T536.pyx [new file with mode: 0644]

index 8bf3560500cd9b9e11207c350c397cabf0dd5cfc..fd274296ba5ab816fa8cd15ccdb585b556bf0d9f 100644 (file)
@@ -11,6 +11,7 @@ cascaded_list_unpacking_T467
 compile.cpp_operators
 cpp_templated_ctypedef
 cpp_structs
+with_statement_module_level_T536
 
 # CPython regression tests that don't current work:
 pyregr.test_threadsignals
diff --git a/tests/run/with_statement_module_level_T536.pyx b/tests/run/with_statement_module_level_T536.pyx
new file mode 100644 (file)
index 0000000..e56c1c9
--- /dev/null
@@ -0,0 +1,18 @@
+
+__doc__ = """
+>>> inner_result
+['ENTER']
+>>> result
+EXIT [None, None, None]
+"""
+
+result = []
+
+class ContextManager(object):
+    def __enter__(self):
+        result.append("ENTER")
+    def __exit__(self, *values):
+        result.append("EXIT [%s]" % values)
+
+with ContextManager() as c:
+    inner_result = result[:]