summaryrefslogtreecommitdiff
path: root/cmd2.py
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2017-04-26 13:34:05 -0400
committerGitHub <noreply@github.com>2017-04-26 13:34:05 -0400
commit90330f29a7fd1ebf03ef2b639f8bc44caf5c379a (patch)
tree7164ad7531a1d1dd02e63abdb3f41326be812fac /cmd2.py
parente8865d377faa0fbe06db79fa35b4b2b4cf838765 (diff)
parent3f92b77af7af983d31a336d215d10e2aaa19fe86 (diff)
downloadcmd2-git-90330f29a7fd1ebf03ef2b639f8bc44caf5c379a.tar.gz
Merge pull request #87 from python-cmd2/transcript_testing
Transcript testing now calls preloop() before and postloop() after
Diffstat (limited to 'cmd2.py')
-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()