Skip to content

Commit

Permalink
Merge pull request #982 from MSeal/runCellTests
Browse files Browse the repository at this point in the history
Added tests for each branch in execute's run_cell method
  • Loading branch information
mpacer committed Apr 16, 2019
2 parents d4168bf + ed25e8f commit 6975629
Show file tree
Hide file tree
Showing 3 changed files with 575 additions and 22 deletions.
7 changes: 3 additions & 4 deletions nbconvert/preprocessors/execute.py
Expand Up @@ -463,7 +463,6 @@ def _wait_for_reply(self, msg_id, cell=None):
self.log.error(
"Kernel died while waiting for execute reply.")
raise RuntimeError("Kernel died")

# kernel still alive, wait for a message
continue
# message received
Expand All @@ -485,9 +484,9 @@ def _wait_for_reply(self, msg_id, cell=None):
continue

def run_cell(self, cell, cell_index=0):
msg_id = self.kc.execute(cell.source)
parent_msg_id = self.kc.execute(cell.source)
self.log.debug("Executing cell:\n%s", cell.source)
exec_reply = self._wait_for_reply(msg_id, cell)
exec_reply = self._wait_for_reply(parent_msg_id, cell)

outs = cell.outputs = []
self.clear_before_next_output = False
Expand All @@ -506,7 +505,7 @@ def run_cell(self, cell, cell_index=0):
raise RuntimeError("Timeout waiting for IOPub output")
else:
break
if msg['parent_header'].get('msg_id') != msg_id:
if msg['parent_header'].get('msg_id') != parent_msg_id:
# not an output from our execution
continue

Expand Down

0 comments on commit 6975629

Please sign in to comment.