Mercurial > mozilla > hg > licenser
diff tests/test.py @ 24:d3e3a506dd29
tests now pass
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Thu, 24 Nov 2011 15:29:05 -0800 |
parents | cf920f85fb98 |
children |
line wrap: on
line diff
--- a/tests/test.py Thu Nov 24 15:11:31 2011 -0800 +++ b/tests/test.py Thu Nov 24 15:29:05 2011 -0800 @@ -11,7 +11,7 @@ import tempfile from optparse import OptionParser -def run_tests(raise_on_error=False, report_first=False): +def run_tests(raise_on_error=False, report_first=False, cleanup=True): # add results here results = {} @@ -43,7 +43,10 @@ raise failure.exc_info[0], failure.exc_info[1], failure.exc_info[2] finally: # cleanup - shutil.rmtree(tempdir) + if cleanup: + shutil.rmtree(tempdir) + else: + print '%s: %s' % (test, tempdir) return results @@ -57,6 +60,9 @@ parser.add_option('--report-first', dest='report_first', default=False, action='store_true', help="report the first error only (all tests will still run)") + parser.add_option('--no-cleanup', dest='cleanup', + action='store_false', default=True, + help="don't cleanup following the tests") options, args = parser.parse_args(args) # run the tests