MCPcopy Create free account
hub / github.com/fabioz/PyDev.Debugger / test_tracing

Function test_tracing

tests_python/test_sys_monitoring.py:230–251  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

228
229
230def test_tracing():
231 import sys
232
233 def method():
234 a = [1, 2, 3, 4, 5, 6] # line 1
235
236 # line 3
237 def b(): # line 4
238 yield from [j for j in a if j % 2 == 0] # line 5
239
240 # line 7
241 for j in b(): # line 8
242 print(j) # line 9
243
244 def tracefunc(frame, event, arg):
245 if "test_sys_monitoring.py" in frame.f_code.co_filename:
246 print(frame.f_code.co_name, event, frame.f_lineno - frame.f_code.co_firstlineno)
247 return tracefunc
248
249 sys.settrace(tracefunc)
250 method()
251 sys.settrace(None)
252
253
254def test_lines_with_yield(with_monitoring):

Callers

nothing calls this directly

Calls 1

methodFunction · 0.70

Tested by

no test coverage detected