From 5a77702462a95de55cd70f5130e244db296abcd5 Mon Sep 17 00:00:00 2001 From: Todd Leonhardt Date: Sun, 30 Sep 2018 11:38:00 -0400 Subject: Fixed transcript testing bug where last command in transcript has no expected output Also: - Added unit test for this specific case --- cmd2/transcript.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'cmd2/transcript.py') diff --git a/cmd2/transcript.py b/cmd2/transcript.py index 2d94f4e4..baaa6caf 100644 --- a/cmd2/transcript.py +++ b/cmd2/transcript.py @@ -67,7 +67,10 @@ class Cmd2TestCase(unittest.TestCase): break line_num += 1 command = [line[len(self.cmdapp.visible_prompt):]] - line = next(transcript) + try: + line = next(transcript) + except StopIteration: + line = '' # Read the entirety of a multi-line command while line.startswith(self.cmdapp.continuation_prompt): command.append(line[len(self.cmdapp.continuation_prompt):]) -- cgit v1.2.1