tests/misc: Improve test coverage of py/profile.c.

Signed-off-by: Jeff Epler <jepler@gmail.com>
This commit is contained in:
Jeff Epler
2025-06-20 19:59:14 +02:00
committed by Damien George
parent fcfed6a0ea
commit ff8c4e5943
3 changed files with 26 additions and 0 deletions

View 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)

View File

@@ -0,0 +1,2 @@
FRAME <frame at 0x\[0-9a-f\]\+, file '\.\*/sys_settrace_cov.py', line \\d\+, code f>
LASTI \\d\+

View File

@@ -354,6 +354,7 @@ special_tests = [
"micropython/meminfo.py",
"basics/bytes_compare3.py",
"basics/builtin_help.py",
"misc/sys_settrace_cov.py",
"thread/thread_exc2.py",
"ports/esp32/partition_ota.py",
)