From: Zac Medico Date: Sat, 3 Aug 2013 01:37:14 +0000 (-0700) Subject: runTests: portage.util._argparse X-Git-Tag: v2.2.0_alpha192~1 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=4b2ff81f880a73cff6a4b9ec67cebeed79bd3382;p=portage.git runTests: portage.util._argparse --- diff --git a/pym/portage/tests/__init__.py b/pym/portage/tests/__init__.py index d90fe6fc5..c0ad112ab 100644 --- a/pym/portage/tests/__init__.py +++ b/pym/portage/tests/__init__.py @@ -7,7 +7,6 @@ from __future__ import print_function import sys import time import unittest -from optparse import OptionParser, OptionValueError try: from unittest.runner import _TextTestResult # new in python-2.7 @@ -18,16 +17,17 @@ import portage from portage import os from portage import _encodings from portage import _unicode_decode +from portage.util._argparse import ArgumentParser def main(): suite = unittest.TestSuite() basedir = os.path.dirname(os.path.realpath(__file__)) usage = "usage: %s [options] [tests to run]" % os.path.basename(sys.argv[0]) - parser = OptionParser(usage=usage) - parser.add_option("-l", "--list", help="list all tests", + parser = ArgumentParser(usage=usage) + parser.add_argument("-l", "--list", help="list all tests", action="store_true", dest="list_tests") - (options, args) = parser.parse_args(args=sys.argv) + options, args = parser.parse_known_args(args=sys.argv) if (os.environ.get('NOCOLOR') in ('yes', 'true') or os.environ.get('TERM') == 'dumb' or