diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-02-15 12:28:24 +0200 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-02-15 12:44:29 +0200 |
commit | 8ac72b9d000ecc48a2d558bdb7c73c7f98d4be62 (patch) | |
tree | c6da86562813aa1b38b5c3a571ffc11144dc02e8 /tests/basics | |
parent | 9307ef46cab5bebcf14440e8ced0787e355751e8 (diff) | |
download | micropython-8ac72b9d000ecc48a2d558bdb7c73c7f98d4be62.tar.gz micropython-8ac72b9d000ecc48a2d558bdb7c73c7f98d4be62.zip |
Add testcase for failing namespace switch throwing exception from a module.
Issue #290. This currently fails, to draw attention to the issue.
Diffstat (limited to 'tests/basics')
-rw-r--r-- | tests/basics/import1b.py | 3 | ||||
-rw-r--r-- | tests/basics/try-module.py | 15 |
2 files changed, 18 insertions, 0 deletions
diff --git a/tests/basics/import1b.py b/tests/basics/import1b.py index 80479088f0..be74eca094 100644 --- a/tests/basics/import1b.py +++ b/tests/basics/import1b.py @@ -1 +1,4 @@ var = 123 + +def throw(): + raise ValueError diff --git a/tests/basics/try-module.py b/tests/basics/try-module.py new file mode 100644 index 0000000000..e62df8487d --- /dev/null +++ b/tests/basics/try-module.py @@ -0,0 +1,15 @@ +# Regression test for #290 - throwing exception in another module led to +# its namespace stick and namespace of current module not coming back. +import import1b + +def func1(): + return + +def func2(): + try: + import1b.throw() + except ValueError: + pass + func1() + +func2() |