本文整理汇总了Python中nose.plugins.Plugin类的典型用法代码示例。如果您正苦于以下问题:Python Plugin类的具体用法?Python Plugin怎么用?Python Plugin使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Plugin类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: configure
def configure(self, options, conf):
Plugin.configure(self, options, conf)
self.pattern = options.pattern
if options.verbosity >= 2:
self.verbose = True
if self.enabled:
err.write("Pattern for matching test mothods is %s\n" % self.pattern)
开发者ID:ArthurWu,项目名称:e-leave,代码行数:7,代码来源:plugin_RegexPicker.py
示例2: options
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.")
开发者ID:scbarber,项目名称:horriblepoems,代码行数:7,代码来源:testid.py
示例3: options
def options(self, parser, env=os.environ):
Plugin.options(self, parser, env)
parser.add_option(
"-u", "--select-unittests", action="store_true",
default=False, dest="select_unittests",
help="Run all unittests"
)
parser.add_option(
"--select-databasetests", action="store_true",
default=False, dest="select_databasetests",
help="Run all database tests"
)
parser.add_option(
"--select-destructivedatabasetests", action="store_true",
default=False, dest="select_destructivedatabasetests",
help="Run all destructive database tests"
)
parser.add_option(
"--select-httptests", action="store_true",
default=False, dest="select_httptests",
help="Run all HTTP tests"
)
parser.add_option(
"--select-seleniumtests", action="store_true",
default=False, dest="select_seleniumtests",
help="Run all Selenium tests"
)
开发者ID:akaihola,项目名称:django-sane-testing,代码行数:27,代码来源:noseplugins.py
示例4: configure
def configure(self, options, config):
# Configure
Plugin.configure(self, options, config)
# Set options
if options.enable_plugin_specplugin:
options.verbosity = max(options.verbosity, 2)
self.spec_doctests = options.spec_doctests
# Color setup
for label, color in list({
'error': 'red',
'ok': 'green',
'deprecated': 'yellow',
'skipped': 'yellow',
'failure': 'red',
'identifier': 'cyan',
'file': 'blue',
}.items()):
# No color: just print() really
func = lambda text, bold=False: text
if not options.no_spec_color:
# Color: colorizes!
func = partial(colorize, color)
# Store in dict (slightly quicker/nicer than getattr)
self.color[label] = func
# Add attribute for easier hardcoded access
setattr(self, label, func)
开发者ID:douglas,项目名称:spec,代码行数:26,代码来源:plugin.py
示例5: configure
def configure(self, options, conf):
"""Configure the plugin"""
Plugin.configure(self, options, conf)
for setting_str in options.env:
env_variable, value = setting_str.split('=')
os.environ[env_variable] = value
开发者ID:msabramo,项目名称:python-noseenv,代码行数:7,代码来源:__init__.py
示例6: options
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]"))
开发者ID:teolisitza,项目名称:nose-artifacts,代码行数:7,代码来源:plugin.py
示例7: options
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.')
开发者ID:FedericoCeratto,项目名称:elcap,代码行数:31,代码来源:plugins.py
示例8: options
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"))
开发者ID:justttry,项目名称:python_testing_cookbook,代码行数:7,代码来源:recipe13_plugin.py
示例9: configure
def configure(self, options, config):
'''Configure the plug in'''
# Call super
Plugin.configure(self, options, config)
# ---------------------------------------------------------------------
# NOSE
# ---------------------------------------------------------------------
# Store the configuration
self.config = config
# Check if processes enabled
try: self.fork = 1 != max(int(options.multiprocess_workers), 1)
# If multiprocess not available
except: self.fork = False
# ---------------------------------------------------------------------
# CORE
# ---------------------------------------------------------------------
# Store test target folder
self.core_target = os.path.abspath(options.core_target)
# Store source folder
if options.source: self.source = os.path.abspath(options.source)
else: self.source = None
# Check if has to search sources
self.search_source = options.search_source
# Check if has to search tests
self.search_test = options.search_test
开发者ID:kassoulet,项目名称:NoseXUnitLite,代码行数:25,代码来源:plugin.py
示例10: __init__
def __init__(self):
Plugin.__init__(self)
import uuid
self.ds_name = "queueblame-%s" % str(uuid.uuid4())[0:6]
from collections import defaultdict
self.queues_by_test = defaultdict(lambda: defaultdict(dict))
开发者ID:swarbhanu,项目名称:pyon,代码行数:7,代码来源:queueblame_plugin.py
示例11: options
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).')
开发者ID:kassoulet,项目名称:NoseXUnitLite,代码行数:31,代码来源:plugin.py
示例12: __init__
def __init__(self):
Plugin.__init__(self)
self.ccs = []
self.container_started = False
self.blames = {"scidata": [], "state": [], "directory": [], "events": [], "resources": [], "objects": []}
self.last_blame = {}
self.sysname = None
开发者ID:rumineykova,项目名称:pyon,代码行数:7,代码来源:pycc_plugin.py
示例13: __init__
def __init__(self):
Plugin.__init__(self)
self.stream_capturer = StreamCapturer()
self.destination = os.environ.get('IPTEST_SUBPROC_STREAMS', 'capture')
# This is ugly, but distant parts of the test machinery need to be able
# to redirect streams, so we make the object globally accessible.
nose.iptest_stdstreams_fileno = self.get_write_fileno
开发者ID:Cadair,项目名称:ipython,代码行数:7,代码来源:iptest.py
示例14: options
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))
开发者ID:kmike,项目名称:ipython,代码行数:25,代码来源:ipdoctest.py
示例15: configure
def configure(self, options, conf):
log.debug("Configuring PSCTest2NosePlugin")
Plugin.configure(self, options, conf)
self.conf = conf
if hasattr(self.conf.options, 'collect_only'):
self.collect_only = getattr(self.conf.options, 'collect_only')
log.debug("self.collect_only is %s" % self.collect_only)
self.buildConfig = getattr(self.conf.options, 'build_config') if hasattr(self.conf.options, 'build_config') else None
开发者ID:perfectsearch,项目名称:sandman,代码行数:8,代码来源:psctest2noseplugin.py
示例16: options
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",
)
开发者ID:noisecapella,项目名称:dependency_tests,代码行数:8,代码来源:plugin.py
示例17: configure
def configure(self, options, config):
Plugin.configure(self, options, config)
self.config = config
if not self.enabled:
return
self._sink = Sink()
开发者ID:thschenk,项目名称:nosetests-json-extended,代码行数:8,代码来源:plugin.py
示例18: options
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")
开发者ID:my8bird,项目名称:nose-randomize,代码行数:8,代码来源:randomize.py
示例19: options
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")
开发者ID:erikzaadi,项目名称:nose-rapido,代码行数:8,代码来源:plugin.py
示例20: configure
def configure(self, options, conf):
"""
Called after the command line has been parsed, with the parsed options and the config container.
Here, implement any config storage or changes to state or operation that are set by command line options.
DO NOT return a value from this method unless you want to stop all other plugins from being configured.
"""
Plugin.configure(self, options, conf)
connection.use_debug_cursor = True
开发者ID:7mp,项目名称:django-dynamic-fixture,代码行数:8,代码来源:nose_plugin.py
注:本文中的nose.plugins.Plugin类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论