本文整理汇总了Python中nose.plugins.Plugin.options方法的典型用法代码示例。如果您正苦于以下问题:Python Plugin.options方法的具体用法?Python Plugin.options怎么用?Python Plugin.options使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nose.plugins.Plugin
的用法示例。
在下文中一共展示了Plugin.options方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: options
# 需要导入模块: from nose.plugins import Plugin [as 别名]
# 或者: from nose.plugins.Plugin import options [as 别名]
def options(self, parser, env):
Plugin.options(self, parser, env)
parser.add_option('--id-file', action='store', dest='testIdFile',
default='.noseids',
help="Store test ids found in test runs in this "
"file. Default is the file .noseids in the "
"working directory.")
示例2: options
# 需要导入模块: from nose.plugins import Plugin [as 别名]
# 或者: from nose.plugins.Plugin import options [as 别名]
def options(self, parser, env=os.environ):
Plugin.options(self, parser, env)
parser.add_option(
"", "--persist-test-database", action="store_true",
default=env.get(self.env_opt), dest="persist_test_database",
help="Do not flush database unless neccessary [%s]" % self.env_opt)
示例3: options
# 需要导入模块: from nose.plugins import Plugin [as 别名]
# 或者: from nose.plugins.Plugin import options [as 别名]
def options(self, parser, env=os.environ):
'''Add launch options for NoseXUnitLite'''
# Call super
Plugin.options(self, parser, env)
# ---------------------------------------------------------------------
# CORE
# ---------------------------------------------------------------------
# Add test target folder
parser.add_option('--core-target',
action='store',
default = nconst.TARGET_CORE,
dest='core_target',
help='Output folder for test reports (default is %s).' % nconst.TARGET_CORE)
# Add source folder
parser.add_option('--source-folder',
action='store',
default=None,
dest='source',
help='Set source folder (optional). Add folder in sys.path.')
# Search sources in source tree
parser.add_option('--search-source',
action='store_true',
default=False,
dest='search_source',
help="Walk in the source folder to add deeper folders in sys.path if they don't contain __init__.py file. Works only if --source-folder is defined.")
# Search tests in
parser.add_option('--search-test',
action='store_true',
default=False,
dest='search_test',
help='Search tests in folders with no __init__.py file (default: do nothing).')
示例4: options
# 需要导入模块: from nose.plugins import Plugin [as 别名]
# 或者: from nose.plugins.Plugin import options [as 别名]
def options(self, parser, env):
Plugin.options(self, parser, env)
parser.add_option("--re-pattern",
dest="pattern", action="store",
default=env.get("NOSE_REGEX_PATTERN", "test.*"),
help=("Run test methods that have a method name \
matching this regular expression"))
示例5: options
# 需要导入模块: from nose.plugins import Plugin [as 别名]
# 或者: from nose.plugins.Plugin import options [as 别名]
def options(self, parser, env=os.environ):
# print "Options for nose plugin:", self.name # dbg
Plugin.options(self, parser, env)
parser.add_option(
"--ipdoctest-tests",
action="store_true",
dest="ipdoctest_tests",
default=env.get("NOSE_IPDOCTEST_TESTS", True),
help="Also look for doctests in test modules. "
"Note that classes, methods and functions should "
"have either doctests or non-doctest tests, "
"not both. [NOSE_IPDOCTEST_TESTS]",
)
parser.add_option(
"--ipdoctest-extension",
action="append",
dest="ipdoctest_extension",
help="Also look for doctests in files with " "this extension [NOSE_IPDOCTEST_EXTENSION]",
)
# Set the default as a list, if given in env; otherwise
# an additional value set on the command line will cause
# an error.
env_setting = env.get("NOSE_IPDOCTEST_EXTENSION")
if env_setting is not None:
parser.set_defaults(ipdoctest_extension=tolist(env_setting))
示例6: options
# 需要导入模块: from nose.plugins import Plugin [as 别名]
# 或者: from nose.plugins.Plugin import options [as 别名]
def options(self, parser, env):
Plugin.options(self, parser, env)
parser.add_option('--mutations-path', action='store',
default='.',
dest='mutations_path',
help='Restrict mutations to source files in this path'
' (default: current working directory)')
parser.add_option('--mutations-exclude', action='store',
metavar='REGEX', default=None,
dest='mutations_exclude',
help='Exclude mutations for source files containing '
'this pattern (default: None)')
parser.add_option('--mutations-exclude-lines', action='store',
metavar='REGEX',
default=self.exclude_lines_pattern,
dest='mutations_exclude_lines',
help='Exclude mutations for lines containing this '
'pattern (default: \'%s\'' %
self.exclude_lines_pattern)
parser.add_option('--mutations-mutators-modules', action='store',
default='elcap.mutator',
dest='mutators_modules',
help='Comma separated list of modules where the '
'Mutators are defined.')
parser.add_option('--mutations-mutators', action='store',
default='',
dest='mutators',
help='Comma separated list of mutators to use. '
'Example: BooleanMutator,NumberMutator. An '
'empty list implies all Mutators in the defined '
'modules will be used.')
示例7: options
# 需要导入模块: from nose.plugins import Plugin [as 别名]
# 或者: from nose.plugins.Plugin import options [as 别名]
def options(self, parser, env):
Plugin.options(self, parser, env)
parser.add_option(
'--artifact-dir', action='store',
dest='artifact_dir', metavar="DIR",
help=("Root artifact directory for testrun. [Default " \
"is new sub-dir under /tmp]"))
示例8: options
# 需要导入模块: from nose.plugins import Plugin [as 别名]
# 或者: from nose.plugins.Plugin import options [as 别名]
def options(self, parser, env):
"""Register commmandline options.
"""
Plugin.options(self, parser, env)
parser.add_option(
"--html-output",
default=env.get('NOSE_OUTPUT_FILE'),
dest="outputFile", help="Dest. of output file")
示例9: options
# 需要导入模块: from nose.plugins import Plugin [as 别名]
# 或者: from nose.plugins.Plugin import options [as 别名]
def options(self, parser, env=os.environ):
Plugin.options(self, parser, env)
parser.add_option(
"--with-dependency",
action="store_true",
dest="dependency",
help="Order tests according to @requires decorators",
)
示例10: options
# 需要导入模块: from nose.plugins import Plugin [as 别名]
# 或者: from nose.plugins.Plugin import options [as 别名]
def options(self, parser, env):
"""Register commandline options.
"""
Plugin.options(self, parser, env)
parser.add_option('--randomize', action='store_true', dest='randomize',
help="Randomize the order of the tests within a unittest.TestCase class")
parser.add_option('--seed', action='store', dest='seed', default=None, type = long,
help="Initialize the seed for deterministic behavior in reproducing failed tests")
示例11: options
# 需要导入模块: from nose.plugins import Plugin [as 别名]
# 或者: from nose.plugins.Plugin import options [as 别名]
def options(self, parser, env=None):
Plugin.options(self, parser, env)
parser.add_option('--rapido-blue', action='store_true',
dest='rapido_blue',
default=False,
help=
"Use the color blue instead of \
green for successfull tests")
示例12: options
# 需要导入模块: from nose.plugins import Plugin [as 别名]
# 或者: from nose.plugins.Plugin import options [as 别名]
def options(self, parser, env):
Plugin.options(self, parser, env)
parser.add_option(
'--json-file', action='store',
dest='json_file', metavar="FILE",
default=env.get('NOSE_JSON_FILE', 'nosetests.json'),
help=("Path to json file to store the report in. "
"Default is nosetests.json in the working directory "
"[NOSE_JSON_FILE]"))
示例13: options
# 需要导入模块: from nose.plugins import Plugin [as 别名]
# 或者: from nose.plugins.Plugin import options [as 别名]
def options(self, parser, env):
"""Sets additional command line options."""
Plugin.options(self, parser, env)
parser.add_option('--dataproviders-first', action="store_true",
default=env.get('DATAPROVIDERS_FIRST', False),
dest="dataproviders_first",
help="If set, will call dataproviders, "
"when before finding tests."
"[DATAPROVIDERS_FIRST]")
示例14: options
# 需要导入模块: from nose.plugins import Plugin [as 别名]
# 或者: from nose.plugins.Plugin import options [as 别名]
def options(self, parser, env=os.environ):
"""Sets additional command line options."""
Plugin.options(self, parser, env)
parser.add_option(
'--lode-report', action='store',
dest='lode_report', metavar="FILE",
default=env.get('LODE_REPORT_FILE', 'lode-report.json'),
help=("Path to xml file to store the lode report in. "
"Default is lode-report.xml in the working directory "
"[LODE_REPORT_FILE]"))
示例15: options
# 需要导入模块: from nose.plugins import Plugin [as 别名]
# 或者: from nose.plugins.Plugin import options [as 别名]
def options(self, parser, env):
"""Sets additional command line options."""
Plugin.options(self, parser, env)
parser.add_option(
'--html-file', action='store',
dest='html_file', metavar="FILE",
default=env.get('NOSE_HTML_FILE', 'nosetests.html'),
help="Path to html file to store the report in. "
"Default is nosetests.html in the working directory "
"[NOSE_HTML_FILE]")