2016-10-10 20:01:22 -04:00
|
|
|
import micropython as micropython
|
|
|
|
|
|
|
|
# check we can get and set the level
|
|
|
|
micropython.opt_level(0)
|
|
|
|
print(micropython.opt_level())
|
|
|
|
micropython.opt_level(1)
|
|
|
|
print(micropython.opt_level())
|
|
|
|
|
|
|
|
# check that the optimisation levels actually differ
|
|
|
|
micropython.opt_level(0)
|
2020-03-22 22:26:08 -04:00
|
|
|
exec("print(__debug__)")
|
2016-10-10 20:01:22 -04:00
|
|
|
micropython.opt_level(1)
|
2020-03-22 22:26:08 -04:00
|
|
|
exec("print(__debug__)")
|
|
|
|
exec("assert 0")
|