Mercurial > sqlpython
changeset 183:34d895615a94
simplifying how to run test
author | catherine@Elli.myhome.westell.com |
---|---|
date | Sat, 08 Nov 2008 11:09:35 -0500 |
parents | b5114b8828b1 |
children | e863f6f67408 |
files | sqlpython/mysqlpy.py |
diffstat | 1 files changed, 5 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/sqlpython/mysqlpy.py Fri Nov 07 06:43:06 2008 -0500 +++ b/sqlpython/mysqlpy.py Sat Nov 08 11:09:35 2008 -0500 @@ -193,11 +193,10 @@ transcriptFileName = 'exampleSession.txt' if __name__ == '__main__': - parser = optparse.OptionParser() - parser.add_option('-t', '--test', dest='unittests', action='store_true', default=False, help='Run unit test suite') - (callopts, callargs) = parser.parse_args() - if callopts.unittests: - sys.argv = [sys.argv[0]] # the --test argument upsets unittest.main() + if os.path.splitext(sys.argv[1])[1] == '.test': + TestCase.transcriptFileName = sys.argv[1] + sys.argv = [sys.argv[0]] unittest.main() else: - run() \ No newline at end of file + run() + \ No newline at end of file