Mercurial > python-cmd2
diff example/example.py @ 257:d62bb3dd58a0
multiple test files still not quite working, yet works when run through debugger, aaargh
author | Catherine Devlin <catherine.devlin@gmail.com> |
---|---|
date | Thu, 02 Apr 2009 15:55:33 -0400 |
parents | 07dff0ba981e |
children | 7a98d7f2da30 |
line wrap: on
line diff
--- a/example/example.py Thu Apr 02 13:41:58 2009 -0400 +++ b/example/example.py Thu Apr 02 15:55:33 2009 -0400 @@ -32,18 +32,14 @@ class TestMyAppCase(Cmd2TestCase): CmdApp = CmdLineApp - transcriptExtension = 'test' parser = optparse.OptionParser() -parser.add_option('-a', '--alltests', dest='test', action="store_true", - help='Run all transcript tests') -parser.add_option('-t', '--testfile', dest='testfile', metavar='FILE', - help='Run a single transcript from file FILE') +parser.add_option('-t', '--test', dest='test', metavar='FILE', + help='''Test against transcript(s) in FILE (wildcards OK)''') (callopts, callargs) = parser.parse_args() -if callopts.testfile or callopts.test: - CmdLineApp.testfile = callopts.testfile - sys.argv = [sys.argv[0]] # the --test argument upsets unittest.main() +if callopts.test: + CmdLineApp.testfile = callopts.test + sys.argv = [sys.argv[0]] # the --test argument upsets unittest.main() unittest.main() else: - app = CmdLineApp() - app.cmdloop() \ No newline at end of file + CmdLineApp().cmdloop() \ No newline at end of file