2023-08-22 11:15:46 -04:00
|
|
|
import micropython
|
2016-10-10 20:01:22 -04:00
|
|
|
|
|
|
|
# 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)
|
2021-03-15 09:57:36 -04:00
|
|
|
exec("print(__debug__)")
|
2016-10-10 20:01:22 -04:00
|
|
|
micropython.opt_level(1)
|
2021-03-15 09:57:36 -04:00
|
|
|
exec("print(__debug__)")
|
|
|
|
exec("assert 0")
|