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

Method run_async_test

Lib/test/test_sys_settrace.py:2062–2080  ·  view source on GitHub ↗
(self, func, jumpFrom, jumpTo, expected, error=None,
                 event='line', decorated=False, warning=None)

Source from the content-addressed store, hash-verified

2060 self.compare_jump_output(expected, output)
2061
2062 def run_async_test(self, func, jumpFrom, jumpTo, expected, error=None,
2063 event='line', decorated=False, warning=None):
2064 wrapped = func
2065 while hasattr(wrapped, '__wrapped__'):
2066 wrapped = wrapped.__wrapped__
2067
2068 tracer = JumpTracer(wrapped, jumpFrom, jumpTo, event, decorated)
2069 sys.settrace(tracer.trace)
2070 output = []
2071
2072 with contextlib.ExitStack() as stack:
2073 if error is not None:
2074 stack.enter_context(self.assertRaisesRegex(*error))
2075 if warning is not None:
2076 stack.enter_context(self.assertWarnsRegex(*warning))
2077 run_no_yield_async_fn(func, output)
2078
2079 sys.settrace(None)
2080 self.compare_jump_output(expected, output)
2081
2082 def jump_test(jumpFrom, jumpTo, expected, error=None, event='line', warning=None):
2083 """Decorator that creates a test that makes a jump

Callers 1

testMethod · 0.95

Calls 6

compare_jump_outputMethod · 0.95
run_no_yield_async_fnFunction · 0.90
JumpTracerClass · 0.85
enter_contextMethod · 0.80
assertRaisesRegexMethod · 0.80
assertWarnsRegexMethod · 0.80

Tested by

no test coverage detected