diff --git a/cmd2.py b/cmd2.py index 4de4a097f..d14c36f88 100755 --- a/cmd2.py +++ b/cmd2.py @@ -2030,6 +2030,10 @@ def setUp(self): 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 @@ def _test_transcript(self, fname, transcript): def tearDown(self): if self.CmdApp: + # Make sure any required cleanup gets done + self.cmdapp.postloop() + self.outputTrap.tear_down()