summaryrefslogtreecommitdiffstatshomepage
path: root/tests/basics/with-break.py
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2014-03-29 04:11:24 +0200
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2014-03-29 04:39:31 +0200
commite7286ef2c7db77879178f45f6055d8af2fc68281 (patch)
tree15c165290fbf90a598062bd0e9b951be782bc44a /tests/basics/with-break.py
parent44307d5ef8f1c78d0a393e8ab842d18799d56517 (diff)
downloadmicropython-e7286ef2c7db77879178f45f6055d8af2fc68281.tar.gz
micropython-e7286ef2c7db77879178f45f6055d8af2fc68281.zip
tests: Add "with" statement testcases.
Diffstat (limited to 'tests/basics/with-break.py')
-rw-r--r--tests/basics/with-break.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/basics/with-break.py b/tests/basics/with-break.py
new file mode 100644
index 0000000000..f1063d5826
--- /dev/null
+++ b/tests/basics/with-break.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))
+
+for i in range(5):
+ print(i)
+ with CtxMgr():
+ if i == 3:
+ break