Skip to content

Commit

Permalink
Fix test of set_next_input
Browse files Browse the repository at this point in the history
Test of set_next input were testing not only that several set_next_input
were not set several time; but was doing so via the side effect that
`?` was triggering set_next_input.

Use directly ip.set_next_input to not rely on the behavior or `?` which
anyway is buggy
  • Loading branch information
Carreau committed Sep 9, 2018
1 parent d062f49 commit c1230aa
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ipykernel/tests/test_message_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -465,8 +465,9 @@ def test_comm_info_request():

def test_single_payload():
flush_channels()
msg_id, reply = execute(code="for i in range(3):\n"+
" x=range?\n")
msg_id, reply = execute(code="ip = get_ipython()\n"
"for i in range(3):\n"
" ip.set_next_input('Hello There')\n")
payload = reply['payload']
next_input_pls = [pl for pl in payload if pl["source"] == "set_next_input"]
assert len(next_input_pls) == 1
Expand Down

0 comments on commit c1230aa

Please sign in to comment.