MCPcopy Create free account
hub / github.com/fabioz/PyDev.Debugger / test_case_suspend_all_thread

Function test_case_suspend_all_thread

tests_python/test_debugger.py:349–375  ·  view source on GitHub ↗
(case_setup)

Source from the content-addressed store, hash-verified

347# thread paused in the debugger).
348@pytest.mark.skipif(IS_JYTHON, reason="Jython can only have one thread stopped at each time.")
349def test_case_suspend_all_thread(case_setup):
350 with case_setup.test_file("_debugger_case_suspend_all.py") as writer:
351 writer.write_make_initial_run()
352
353 main_thread_id = writer.wait_for_new_thread() # Main thread
354 thread_id1 = writer.wait_for_new_thread() # Thread 1
355 thread_id2 = writer.wait_for_new_thread() # Thread 2
356
357 # Ok, all threads created, let's wait for the main thread to get to the join.
358 writer.wait_for_thread_join(main_thread_id)
359
360 writer.write_suspend_thread("*")
361
362 # Wait for 2 threads to be suspended (the main thread is already in a join, so, it can't actually
363 # break out of it while others don't proceed).
364 hit0 = writer.wait_for_breakpoint_hit(REASON_THREAD_SUSPEND)
365 hit1 = writer.wait_for_breakpoint_hit(REASON_THREAD_SUSPEND)
366
367 writer.write_evaluate_expression("%s\t%s\t%s" % (hit0.thread_id, hit0.frame_id, "LOCAL"), "exit_while_loop(1)")
368 writer.wait_for_evaluation([['<var name="exit_while_loop(1)" type="str" qualifier="{0}" value="str: ok'.format(builtin_qualifier)]])
369
370 writer.write_evaluate_expression("%s\t%s\t%s" % (hit1.thread_id, hit1.frame_id, "LOCAL"), "exit_while_loop(2)")
371 writer.wait_for_evaluation('<var name="exit_while_loop(2)" type="str" qualifier="{0}" value="str: ok'.format(builtin_qualifier))
372
373 writer.write_run_thread("*")
374
375 writer.finished_ok = True
376
377
378def test_case_5(case_setup):

Callers

nothing calls this directly

Calls 8

test_fileMethod · 0.80
wait_for_new_threadMethod · 0.80
wait_for_thread_joinMethod · 0.80
write_suspend_threadMethod · 0.80
write_run_threadMethod · 0.80

Tested by

no test coverage detected