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

Method test_handle_eof

Lib/test/test_remote_pdb.py:1274–1293  ·  view source on GitHub ↗

Test that EOF signal properly exits the debugger.

(self)

Source from the content-addressed store, hash-verified

1272 self.assertEqual(process.returncode, 0)
1273
1274 def test_handle_eof(self):
1275 """Test that EOF signal properly exits the debugger."""
1276 self._create_script()
1277 process, client_file = self._connect_and_get_client_file()
1278
1279 with kill_on_error(process):
1280 # Skip initial messages until we get to the prompt
1281 self._read_until_prompt(client_file)
1282
1283 # Send EOF signal to exit the debugger
1284 client_file.write(json.dumps({"signal": "EOF"}).encode() + b"\n")
1285 client_file.flush()
1286
1287 # The process should complete normally after receiving EOF
1288 stdout, stderr = process.communicate(timeout=SHORT_TIMEOUT)
1289
1290 # Verify process completed correctly
1291 self.assertIn("Function returned: 42", stdout)
1292 self.assertEqual(process.returncode, 0)
1293 self.assertEqual(stderr, "")
1294
1295 def test_protocol_version(self):
1296 """Test that incompatible protocol versions are properly detected."""

Callers

nothing calls this directly

Calls 11

_create_scriptMethod · 0.95
_read_until_promptMethod · 0.95
assertInMethod · 0.80
kill_on_errorFunction · 0.70
writeMethod · 0.45
encodeMethod · 0.45
dumpsMethod · 0.45
flushMethod · 0.45
communicateMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected