mirror of
https://github.com/micropython/micropython.git
synced 2026-01-07 12:40:15 +01:00
tests/misc: Improve test coverage of py/profile.c.
Signed-off-by: Jeff Epler <jepler@gmail.com>
This commit is contained in:
committed by
Damien George
parent
fcfed6a0ea
commit
ff8c4e5943
23
tests/misc/sys_settrace_cov.py
Normal file
23
tests/misc/sys_settrace_cov.py
Normal file
@@ -0,0 +1,23 @@
|
||||
import sys
|
||||
|
||||
try:
|
||||
sys.settrace
|
||||
except AttributeError:
|
||||
print("SKIP")
|
||||
raise SystemExit
|
||||
|
||||
|
||||
def trace_tick_handler(frame, event, arg):
|
||||
print("FRAME", frame)
|
||||
print("LASTI", frame.f_lasti)
|
||||
return None
|
||||
|
||||
|
||||
def f():
|
||||
x = 3
|
||||
return x
|
||||
|
||||
|
||||
sys.settrace(trace_tick_handler)
|
||||
f()
|
||||
sys.settrace(None)
|
||||
Reference in New Issue
Block a user