From d9412be350ae4a026121d0f3f31280349d6517cc Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Tue, 1 Jun 2010 08:36:18 +0200 Subject: [PATCH] test for ticket #536 --- tests/bugs.txt | 1 + tests/run/with_statement_module_level_T536.pyx | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 tests/run/with_statement_module_level_T536.pyx 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[:] -- 2.26.2