MCPcopy Index your code
hub / github.com/RustPython/RustPython / _trace

Method _trace

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

Source from the content-addressed store, hash-verified

3416
3417 @staticmethod
3418 def _trace(func, *args, **kwargs):
3419 actual_linenos = []
3420
3421 def trace(frame, event, arg):
3422 if event == "line" and frame.f_code.co_name == func.__name__:
3423 assert arg is None
3424 relative_lineno = frame.f_lineno - func.__code__.co_firstlineno
3425 actual_linenos.append(relative_lineno)
3426 return trace
3427
3428 old_trace = sys.gettrace()
3429 sys.settrace(trace)
3430 try:
3431 func(*args, **kwargs)
3432 finally:
3433 sys.settrace(old_trace)
3434 return actual_linenos
3435
3436 @unittest.expectedFailure # TODO: RUSTPYTHON
3437 def test_default_wildcard(self):

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