MCPcopy Create free account
hub / github.com/dask/dask / assert_tb_levels

Function assert_tb_levels

dask/tests/test_traceback.py:21–27  ·  view source on GitHub ↗
(expect)

Source from the content-addressed store, hash-verified

19
20@contextmanager
21def assert_tb_levels(expect):
22 with pytest.raises(ZeroDivisionError) as e:
23 yield
24 frames = list(traceback.walk_tb(e.tb))
25 frame_names = [frame[0].f_code.co_name for frame in frames]
26 assert frame_names[0] == "assert_tb_levels", frame_names
27 assert frame_names[1:] == expect, frame_names
28
29
30def f1():

Calls

no outgoing calls

Tested by

no test coverage detected