summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2014-04-04 12:14:11 +0300
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2014-04-04 12:15:39 +0300
commit072cf022e007e03a8b850a7197585403868923ab (patch)
treec3825dc774ab7ffaca27c2e1380ebab2cf30997a
parent5bf565e353b73bc87e0b918368dadac701644078 (diff)
downloadmicropython-072cf022e007e03a8b850a7197585403868923ab.tar.gz
micropython-072cf022e007e03a8b850a7197585403868923ab.zip
tests/file-with: Add testcase which failed for @dpgeorge.
Works on x86.
-rw-r--r--tests/io/file-with.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/io/file-with.py b/tests/io/file-with.py
index 2350721641..ee1e702422 100644
--- a/tests/io/file-with.py
+++ b/tests/io/file-with.py
@@ -10,3 +10,12 @@ except:
# Note: CPython and us throw different exception trying to read from
# close file.
print("can't read file after with")
+
+
+# Regression test: test that exception in with initialization properly
+# thrown and doesn't crash.
+try:
+ with open('__non_existent', 'r'):
+ pass
+except OSError:
+ print("OSError")