MCPcopy Index your code
hub / github.com/python/cpython / test_interact_mode

Method test_interact_mode

Lib/test/test_remote_pdb.py:922–938  ·  view source on GitHub ↗

Test interaction mode setup and execution.

(self)

Source from the content-addressed store, hash-verified

920 self.assertEqual(outputs[0], {"help": "break"})
921
922 def test_interact_mode(self):
923 """Test interaction mode setup and execution."""
924 # First set up interact mode
925 self.pdb.do_interact("")
926
927 # Verify _interact_state is properly initialized
928 self.assertIsNotNone(self.pdb._interact_state)
929 self.assertIsInstance(self.pdb._interact_state, dict)
930
931 # Test running code in interact mode
932 with unittest.mock.patch.object(self.pdb, '_error_exc') as mock_error:
933 self.pdb._run_in_python_repl("print('test')")
934 mock_error.assert_not_called()
935
936 # Test with syntax error
937 self.pdb._run_in_python_repl("if:")
938 mock_error.assert_called_once()
939
940 def test_registering_commands(self):
941 """Test registering breakpoint commands."""

Callers

nothing calls this directly

Calls 6

assertIsNotNoneMethod · 0.80
assertIsInstanceMethod · 0.80
_run_in_python_replMethod · 0.80
assert_not_calledMethod · 0.80
assert_called_onceMethod · 0.80
do_interactMethod · 0.45

Tested by

no test coverage detected