MCPcopy Index your code
hub / github.com/python/cpython / _trace

Method _trace

Lib/test/test_patma.py:3411–3427  ·  view source on GitHub ↗
(func, *args, **kwargs)

Source from the content-addressed store, hash-verified

3409
3410 @staticmethod
3411 def _trace(func, *args, **kwargs):
3412 actual_linenos = []
3413
3414 def trace(frame, event, arg):
3415 if event == "line" and frame.f_code.co_name == func.__name__:
3416 assert arg is None
3417 relative_lineno = frame.f_lineno - func.__code__.co_firstlineno
3418 actual_linenos.append(relative_lineno)
3419 return trace
3420
3421 old_trace = sys.gettrace()
3422 sys.settrace(trace)
3423 try:
3424 func(*args, **kwargs)
3425 finally:
3426 sys.settrace(old_trace)
3427 return actual_linenos
3428
3429 def test_default_wildcard(self):
3430 def f(command): # 0

Callers 7

test_default_wildcardMethod · 0.95
test_default_captureMethod · 0.95
test_no_defaultMethod · 0.95
test_unreachable_codeMethod · 0.95
test_traceMethod · 0.80

Calls 1

funcFunction · 0.70

Tested by

no test coverage detected