@@ -1208,23 +1208,19 @@ def test_ctrl_d_at_prompt(say_app, monkeypatch) -> None:
12081208 reason = "Don't have a real Windows console with how we are currently running tests in GitHub Actions" ,
12091209)
12101210@pytest .mark .parametrize (
1211- ('msg' , 'prompt' , 'is_stale' , 'at_continuation_prompt' ),
1211+ ('msg' , 'prompt' , 'is_stale' ),
12121212 [
1213- ("msg_text" , None , False , False ),
1214- ("msg_text" , "new_prompt> " , False , False ),
1215- ("msg_text" , "new_prompt> " , False , True ),
1216- ("msg_text" , "new_prompt> " , True , False ),
1217- ("msg_text" , "new_prompt> " , True , True ),
1218- (None , "new_prompt> " , False , False ),
1219- (None , "new_prompt> " , False , True ),
1220- (None , "new_prompt> " , True , False ),
1221- (None , "new_prompt> " , True , True ),
1213+ ("msg_text" , None , False ),
1214+ ("msg_text" , "new_prompt> " , False ),
1215+ ("msg_text" , "new_prompt> " , True ),
1216+ (None , "new_prompt> " , False ),
1217+ (None , "new_prompt> " , True ),
12221218 # Blank prompt is acceptable
1223- ("msg_text" , "" , False , False ),
1224- (None , "" , False , False ),
1219+ ("msg_text" , "" , False ),
1220+ (None , "" , False ),
12251221 ],
12261222)
1227- def test_async_alert (base_app , msg , prompt , is_stale , at_continuation_prompt ) -> None :
1223+ def test_async_alert (base_app , msg , prompt , is_stale ) -> None :
12281224 import time
12291225
12301226 with (
@@ -1246,8 +1242,6 @@ def test_async_alert(base_app, msg, prompt, is_stale, at_continuation_prompt) ->
12461242 # In the future
12471243 alert .timestamp = time .monotonic () + 99999999
12481244
1249- base_app ._at_continuation_prompt = at_continuation_prompt
1250-
12511245 with create_pipe_input () as pipe_input :
12521246 base_app .main_session = PromptSession (
12531247 input = pipe_input ,
@@ -1266,7 +1260,7 @@ def test_async_alert(base_app, msg, prompt, is_stale, at_continuation_prompt) ->
12661260
12671261 # If there's only a prompt update, we expect invalidate() only if not continuation/stale
12681262 elif prompt is not None :
1269- if is_stale or at_continuation_prompt :
1263+ if is_stale :
12701264 mock_app .invalidate .assert_not_called ()
12711265 else :
12721266 mock_app .invalidate .assert_called_once ()
@@ -1819,9 +1813,6 @@ def test_multiline_complete_statement_without_terminator(multiline_app, monkeypa
18191813 assert statement .command == command
18201814 assert statement .multiline_command
18211815
1822- pt_history = multiline_app .main_session .history .get_strings ()
1823- assert pt_history [0 ] == statement .raw
1824-
18251816
18261817def test_multiline_complete_statement_with_unclosed_quotes (multiline_app , monkeypatch ) -> None :
18271818 read_command_mock = mock .MagicMock (name = '_read_command_line' , side_effect = ['quotes' , '" now closed;' ])
@@ -1834,9 +1825,6 @@ def test_multiline_complete_statement_with_unclosed_quotes(multiline_app, monkey
18341825 assert statement .multiline_command
18351826 assert statement .terminator == ';'
18361827
1837- pt_history = multiline_app .main_session .history .get_strings ()
1838- assert pt_history [0 ] == statement .raw
1839-
18401828
18411829def test_multiline_input_line_to_statement (multiline_app , monkeypatch ) -> None :
18421830 # Verify _input_line_to_statement saves the fully entered input line for multiline commands
@@ -1850,9 +1838,6 @@ def test_multiline_input_line_to_statement(multiline_app, monkeypatch) -> None:
18501838 assert statement .command == 'orate'
18511839 assert statement .multiline_command
18521840
1853- pt_history = multiline_app .main_session .history .get_strings ()
1854- assert pt_history [0 ] == statement .raw
1855-
18561841
18571842def test_multiline_history_added (multiline_app , monkeypatch ) -> None :
18581843 # Test that multiline commands are added to history as a single item
@@ -1864,13 +1849,8 @@ def test_multiline_history_added(multiline_app, monkeypatch) -> None:
18641849 # run_cmd calls onecmd_plus_hooks which triggers history addition
18651850 run_cmd (multiline_app , "orate hi" )
18661851
1867- expected = "orate hi\n person\n \n "
18681852 assert len (multiline_app .history ) == 1
1869- assert multiline_app .history .get (1 ).raw == expected
1870-
1871- pt_history = multiline_app .main_session .history .get_strings ()
1872- assert len (pt_history ) == 1
1873- assert pt_history [0 ] == expected
1853+ assert multiline_app .history .get (1 ).raw == "orate hi\n person\n \n "
18741854
18751855
18761856def test_multiline_history_with_quotes (multiline_app , monkeypatch ) -> None :
@@ -1893,10 +1873,6 @@ def test_multiline_history_with_quotes(multiline_app, monkeypatch) -> None:
18931873 assert history_lines [4 ] == 'quotes.'
18941874 assert history_lines [5 ] == ';'
18951875
1896- pt_history = multiline_app .main_session .history .get_strings ()
1897- assert len (pt_history ) == 1
1898- assert pt_history [0 ] == history_item .raw
1899-
19001876
19011877def test_multiline_complete_statement_eof (multiline_app , monkeypatch ):
19021878 # Mock poutput to verify it's called
@@ -1918,9 +1894,6 @@ def test_multiline_complete_statement_eof(multiline_app, monkeypatch):
19181894 assert statement .args == args
19191895 assert statement .terminator == '\n '
19201896
1921- pt_history = multiline_app .main_session .history .get_strings ()
1922- assert pt_history [0 ] == statement .raw
1923-
19241897 # Verify that poutput('\n') was called
19251898 poutput_mock .assert_called_once_with ('\n ' )
19261899
0 commit comments