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

Method test_ctrl_d_empty_line

Lib/test/test_pyrepl/test_pyrepl.py:2395–2402  ·  view source on GitHub ↗

Test that pressing Ctrl+D on empty line exits the program

(self)

Source from the content-addressed store, hash-verified

2393 return reader
2394
2395 def test_ctrl_d_empty_line(self):
2396 """Test that pressing Ctrl+D on empty line exits the program"""
2397 events = [
2398 Event(evt="key", data="\x04", raw=bytearray(b"\x04")), # Ctrl+D
2399 ]
2400 reader = self.prepare_reader(events)
2401 with self.assertRaises(EOFError):
2402 multiline_input(reader)
2403
2404 def test_ctrl_d_multiline_with_new_line(self):
2405 """Test that pressing Ctrl+D in multiline mode with trailing newline exits multiline mode"""

Callers

nothing calls this directly

Calls 4

prepare_readerMethod · 0.95
EventClass · 0.90
multiline_inputFunction · 0.85
assertRaisesMethod · 0.45

Tested by

no test coverage detected