summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xcmd2.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/cmd2.py b/cmd2.py
index 4de4a097..d14c36f8 100755
--- a/cmd2.py
+++ b/cmd2.py
@@ -2030,6 +2030,10 @@ class Cmd2TestCase(unittest.TestCase):
self.cmdapp = self.CmdApp()
self.fetchTranscripts()
+ # Make sure any required initialization gets done and flush the output buffer
+ self.cmdapp.preloop()
+ self.outputTrap.read()
+
def runTest(self): # was testall
if self.CmdApp:
its = sorted(self.transcripts.items())
@@ -2095,6 +2099,9 @@ class Cmd2TestCase(unittest.TestCase):
def tearDown(self):
if self.CmdApp:
+ # Make sure any required cleanup gets done
+ self.cmdapp.postloop()
+
self.outputTrap.tear_down()