Skip to content

Commit fb58380

Browse files
committed
tests/micropython/opt_level: Add test for opt_level 3.
1 parent 4c4f586 commit fb58380

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

tests/micropython/opt_level.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,7 @@
1212
micropython.opt_level(1)
1313
exec('print(__debug__)')
1414
exec('assert 0')
15+
16+
# check that level 3 doesn't store line numbers
17+
micropython.opt_level(3)
18+
exec('try:\n xyz\nexcept NameError as er:\n import sys\n sys.print_exception(er)')

tests/micropython/opt_level.py.exp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,6 @@
22
1
33
True
44
False
5+
Traceback (most recent call last):
6+
File "<string>", line 1, in <module>
7+
NameError: name 'xyz' is not defined

0 commit comments

Comments
 (0)