diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-04-04 12:14:11 +0300 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-04-04 12:15:39 +0300 |
commit | 072cf022e007e03a8b850a7197585403868923ab (patch) | |
tree | c3825dc774ab7ffaca27c2e1380ebab2cf30997a | |
parent | 5bf565e353b73bc87e0b918368dadac701644078 (diff) | |
download | micropython-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.py | 9 |
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") |