(case_setup_dap, pyfile)
| 4507 | reason="Gevent not installed / Sometimes the debugger crashes on Windows as the compiled extensions conflict with gevent.", |
| 4508 | ) |
| 4509 | def test_notify_gevent(case_setup_dap, pyfile): |
| 4510 | |
| 4511 | def get_environ(writer): |
| 4512 | # I.e.: Make sure that gevent support is disabled |
| 4513 | env = os.environ.copy() |
| 4514 | env["GEVENT_SUPPORT"] = "" |
| 4515 | return env |
| 4516 | |
| 4517 | @pyfile |
| 4518 | def case_gevent(): |
| 4519 | from gevent import monkey |
| 4520 | import os |
| 4521 | |
| 4522 | monkey.patch_all() |
| 4523 | print("TEST SUCEEDED") # Break here |
| 4524 | os._exit(0) |
| 4525 | |
| 4526 | def additional_output_checks(writer, stdout, stderr): |
| 4527 | assert "environment variable" in stderr |
| 4528 | assert "GEVENT_SUPPORT=True" in stderr |
| 4529 | |
| 4530 | with case_setup_dap.test_file( |
| 4531 | case_gevent, |
| 4532 | get_environ=get_environ, |
| 4533 | additional_output_checks=additional_output_checks, |
| 4534 | EXPECTED_RETURNCODE="any", |
| 4535 | FORCE_KILL_PROCESS_WHEN_FINISHED_OK=True, |
| 4536 | ) as writer: |
| 4537 | json_facade = JsonFacade(writer) |
| 4538 | json_facade.write_launch(justMyCode=False) |
| 4539 | json_facade.write_set_breakpoints(writer.get_line_index_with_content("Break here")) |
| 4540 | json_facade.write_make_initial_run() |
| 4541 | json_facade.wait_for_thread_stopped() |
| 4542 | json_facade.write_continue(wait_for_response=False) |
| 4543 | |
| 4544 | wait_for_condition(lambda: "GEVENT_SUPPORT=True" in writer.get_stderr()) |
| 4545 | |
| 4546 | writer.finished_ok = True |
| 4547 | |
| 4548 | |
| 4549 | def test_ppid(case_setup_dap, pyfile): |
nothing calls this directly
no test coverage detected