aboutsummaryrefslogtreecommitdiff
path: root/tests/basics/with_return.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/basics/with_return.py')
-rw-r--r--tests/basics/with_return.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/basics/with_return.py b/tests/basics/with_return.py
new file mode 100644
index 000000000..cb0135c8b
--- /dev/null
+++ b/tests/basics/with_return.py
@@ -0,0 +1,14 @@
+class CtxMgr:
+
+ def __enter__(self):
+ print("__enter__")
+ return self
+
+ def __exit__(self, a, b, c):
+ print("__exit__", repr(a), repr(b))
+
+def foo():
+ with CtxMgr():
+ return 4
+
+print(foo())