本文整理匯總了Python中pyutilib.misc.Options.debug方法的典型用法代碼示例。如果您正苦於以下問題:Python Options.debug方法的具體用法?Python Options.debug怎麽用?Python Options.debug使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pyutilib.misc.Options
的用法示例。
在下文中一共展示了Options.debug方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: run
# 需要導入模塊: from pyutilib.misc import Options [as 別名]
# 或者: from pyutilib.misc.Options import debug [as 別名]
def run(argv, _globals=None):
#
# Set sys.argv to the value specified by the user
#
sys.argv = argv
#
# Create the option parser
#
parser = optparse.OptionParser()
parser.remove_option('-h')
#
parser.add_option('-h','--help',
action='store_true',
dest='help',
default=False,
help='Print command options')
#
parser.add_option('-d','--debug',
action='store_true',
dest='debug',
default=False,
help='Set debugging flag')
#
parser.add_option('-v','--verbose',
action='store_true',
dest='verbose',
default=False,
help='Verbose output')
#
parser.add_option('-q','--quiet',
action='store_true',
dest='quiet',
default=False,
help='Minimal output')
#
parser.add_option('-f','--failfast',
action='store_true',
dest='failfast',
default=False,
help='Stop on first failure')
#
parser.add_option('-c','--catch',
action='store_true',
dest='catch',
default=False,
help='Catch control-C and display results')
#
parser.add_option('-b','--buffer',
action='store_true',
dest='buffer',
default=False,
help='Buffer stdout and stderr durring test runs')
#
parser.add_option('--cat', '--category',
action='append',
dest='categories',
default=[],
help='Define a list of categories that filter the execution of test suites')
#
parser.add_option('--help-suites',
action='store_true',
dest='help_suites',
default=False,
help='Print the test suites that can be executed')
#
parser.add_option('--help-tests',
action='store',
dest='help_tests',
default=None,
help='Print the tests in the specified test suite')
#
parser.add_option('--help-categories',
action='store_true',
dest='help_categories',
default=False,
help='Print the test suite categories that can be specified')
#
# Parse the argument list and print help info if needed
#
_options, args = parser.parse_args(sys.argv)
if _options.help:
parser.print_help()
print("""
Examples:
%s - run all test suites
%s MyTestCase.testSomething - run MyTestCase.testSomething
%s MyTestCase - run all 'test*' test methods
in MyTestCase
""" % (args[0],args[0],args[0]))
return
#
# If no value for _globals is specified, then we use the current context.
#
if _globals is None:
_globals=globals()
#
# Setup and Options object and create test suites from the specified
# configuration files.
#
#.........這裏部分代碼省略.........