diff --git a/tests/devx/conftest.py b/tests/devx/conftest.py index e1ad2ea3..8bc800ec 100644 --- a/tests/devx/conftest.py +++ b/tests/devx/conftest.py @@ -22,7 +22,7 @@ from tractor.devx._debug import ( _repl_fail_msg as _repl_fail_msg, _ctlc_ignore_header as _ctlc_ignore_header, ) -from conftest import ( +from ..conftest import ( _ci_env, ) diff --git a/tests/devx/test_debugger.py b/tests/devx/test_debugger.py index 254b92a1..8b723c6f 100644 --- a/tests/devx/test_debugger.py +++ b/tests/devx/test_debugger.py @@ -29,7 +29,6 @@ from .conftest import ( _repl_fail_msg, ) from .conftest import ( - _ci_env, expect, in_prompt_msg, assert_before, diff --git a/tests/devx/test_tooling.py b/tests/devx/test_tooling.py index 3e48844e..1ed741e8 100644 --- a/tests/devx/test_tooling.py +++ b/tests/devx/test_tooling.py @@ -19,7 +19,13 @@ import signal from .conftest import ( expect, assert_before, - # in_prompt_msg, + in_prompt_msg, + PROMPT, + _pause_msg, +) +from pexpect.exceptions import ( + # TIMEOUT, + EOF, ) @@ -118,3 +124,50 @@ def test_shield_pause( "'--uid', \"('hanger',", ] ) + + +def test_breakpoint_hook_restored( + spawn, +): + ''' + Ensures our actor runtime sets a custom `breakpoint()` hook + on open then restores the stdlib's default on close. + + The hook state validation is done via `assert`s inside the + invoked script with only `breakpoint()` (not `tractor.pause()`) + calls used. + + ''' + child = spawn('restore_builtin_breakpoint') + + child.expect(PROMPT) + assert_before( + child, + [ + _pause_msg, + "