diff --git a/tests/ptvsd/server/test_tracing.py b/tests/ptvsd/server/test_tracing.py index 49a4ca58..b911d746 100644 --- a/tests/ptvsd/server/test_tracing.py +++ b/tests/ptvsd/server/test_tracing.py @@ -8,12 +8,10 @@ from tests import debug from tests.patterns import some -def test_tracing(pyfile, start_method, run_as): - +def test_tracing(pyfile, target, run): @pyfile def code_to_debug(): import debug_me # noqa - import ptvsd def func(expected_tracing): @@ -51,39 +49,26 @@ def test_tracing(pyfile, start_method, run_as): print(0) # @outer2 func(True) - with debug.Session(start_method, client_id='vscode') as session: - session.configure(run_as, code_to_debug) - session.set_breakpoints(code_to_debug, all) - session.start_debugging() - - stop = session.wait_for_stop() - frame = stop.frames[0] - assert frame == some.dict.containing({ - "line": code_to_debug.lines["inner2"], - }) + with debug.Session() as session: + with run(session, target(code_to_debug)): + session.set_breakpoints(code_to_debug, all) + session.wait_for_stop( + expected_frames=[some.dap.frame(code_to_debug, "inner2")] + ) session.request_continue() - stop = session.wait_for_stop() - frame = stop.frames[0] - assert frame == some.dict.containing({ - "line": code_to_debug.lines["outer2"], - }) - + session.wait_for_stop( + expected_frames=[some.dap.frame(code_to_debug, "outer2")] + ) session.request_continue() - stop = session.wait_for_stop() - frame = stop.frames[0] - assert frame == some.dict.containing({ - "line": code_to_debug.lines["inner1"], - }) - + session.wait_for_stop( + expected_frames=[some.dap.frame(code_to_debug, "inner1")] + ) session.request_continue() - stop = session.wait_for_stop() - frame = stop.frames[0] - assert frame == some.dict.containing({ - "line": code_to_debug.lines["inner3"], - }) - + session.wait_for_stop( + expected_frames=[some.dap.frame(code_to_debug, "inner3")] + ) session.request_continue()