From: Stefan Behnel Date: Tue, 1 Jun 2010 06:36:18 +0000 (+0200) Subject: test for ticket #536 X-Git-Tag: 0.13.beta0~58 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=d9412be350ae4a026121d0f3f31280349d6517cc;p=cython.git test for ticket #536 --- diff --git a/tests/bugs.txt b/tests/bugs.txt index 8bf35605..fd274296 100644 --- a/tests/bugs.txt +++ b/tests/bugs.txt @@ -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 index 00000000..e56c1c92 --- /dev/null +++ b/tests/run/with_statement_module_level_T536.pyx @@ -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[:]