diff options
author | Damien George <damien.p.george@gmail.com> | 2017-01-19 23:38:11 +1100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2017-01-19 23:38:11 +1100 |
commit | fb5838041b2349c7df5b2f90317b6cc7ec657f84 (patch) | |
tree | 48c538d57938c9439c7bb3deab7c3e58a15fd0b2 | |
parent | 4c4f586e2c798a28ea441fd3ddd409806672138f (diff) |
tests/micropython/opt_level: Add test for opt_level 3.
-rw-r--r-- | tests/micropython/opt_level.py | 4 | ||||
-rw-r--r-- | tests/micropython/opt_level.py.exp | 3 |
2 files changed, 7 insertions, 0 deletions
diff --git a/tests/micropython/opt_level.py b/tests/micropython/opt_level.py index 4e2f2f4ea..e067ec651 100644 --- a/tests/micropython/opt_level.py +++ b/tests/micropython/opt_level.py @@ -12,3 +12,7 @@ exec('print(__debug__)') micropython.opt_level(1) exec('print(__debug__)') exec('assert 0') + +# check that level 3 doesn't store line numbers +micropython.opt_level(3) +exec('try:\n xyz\nexcept NameError as er:\n import sys\n sys.print_exception(er)') diff --git a/tests/micropython/opt_level.py.exp b/tests/micropython/opt_level.py.exp index 74b3dd74e..9b1bb4d24 100644 --- a/tests/micropython/opt_level.py.exp +++ b/tests/micropython/opt_level.py.exp @@ -2,3 +2,6 @@ 1 True False +Traceback (most recent call last): + File "<string>", line 1, in <module> +NameError: name 'xyz' is not defined |