本文整理汇总了Python中nose.plugins.Plugin.configure方法的典型用法代码示例。如果您正苦于以下问题:Python Plugin.configure方法的具体用法?Python Plugin.configure怎么用?Python Plugin.configure使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nose.plugins.Plugin
的用法示例。
在下文中一共展示了Plugin.configure方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: configure
# 需要导入模块: from nose.plugins import Plugin [as 别名]
# 或者: from nose.plugins.Plugin import configure [as 别名]
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
示例2: configure
# 需要导入模块: from nose.plugins import Plugin [as 别名]
# 或者: from nose.plugins.Plugin import configure [as 别名]
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
示例3: configure
# 需要导入模块: from nose.plugins import Plugin [as 别名]
# 或者: from nose.plugins.Plugin import configure [as 别名]
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)
示例4: configure
# 需要导入模块: from nose.plugins import Plugin [as 别名]
# 或者: from nose.plugins.Plugin import configure [as 别名]
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)
示例5: configure
# 需要导入模块: from nose.plugins import Plugin [as 别名]
# 或者: from nose.plugins.Plugin import configure [as 别名]
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
示例6: configure
# 需要导入模块: from nose.plugins import Plugin [as 别名]
# 或者: from nose.plugins.Plugin import configure [as 别名]
def configure(self, options, config):
Plugin.configure(self, options, config)
self.config = config
if not self.enabled:
return
self._sink = Sink()
示例7: configure
# 需要导入模块: from nose.plugins import Plugin [as 别名]
# 或者: from nose.plugins.Plugin import configure [as 别名]
def configure(self, options, conf):
"""Configure the plugin based on provided options"""
Plugin.configure(self, options, conf)
if options.show_each_error:
self.show_each_error = True
if options.show_each_failure:
self.show_each_failure = True
示例8: configure
# 需要导入模块: from nose.plugins import Plugin [as 别名]
# 或者: from nose.plugins.Plugin import configure [as 别名]
def configure(self, options, conf):
Plugin.configure(self, options, conf)
conf.exclude = map(re.compile, tolist(r'^(manage\.py|.*settings\.py|apps)$'))
if options.django_settings and self.env is not None:
self.env['DJANGO_SETTINGS_MODULE'] = options.django_settings
self.verbosity = conf.verbosity
示例9: configure
# 需要导入模块: from nose.plugins import Plugin [as 别名]
# 或者: from nose.plugins.Plugin import configure [as 别名]
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
示例10: configure
# 需要导入模块: from nose.plugins import Plugin [as 别名]
# 或者: from nose.plugins.Plugin import configure [as 别名]
def configure(self, options, config):
Plugin.configure(self, options, config)
#==
if not self.enabled:
return
#==
self.report_path = options.report_file
if options.template_file:
self.html_path, self.template_path = os.path.split(options.template_file)
示例11: configure
# 需要导入模块: from nose.plugins import Plugin [as 别名]
# 或者: from nose.plugins.Plugin import configure [as 别名]
def configure(self, options, config):
global HTTP_PORT, SELENIUM_GRID_PORT
Plugin.configure(self, options, config)
HTTP_PORT = options.HTTP_PORT
SELENIUM_GRID_PORT = options.SELENIUM_GRID_PORT
self.browsers = options.browsers
self.enabled = True
示例12: configure
# 需要导入模块: from nose.plugins import Plugin [as 别名]
# 或者: from nose.plugins.Plugin import configure [as 别名]
def configure(self, options, config):
Plugin.configure(self, options, config)
self.doctest_tests = options.doctest_tests
self.extension = tolist(options.doctestExtension)
self.parser = doctest.DocTestParser()
self.finder = DocTestFinder()
self.checker = IPDoctestOutputChecker()
self.globs = None
self.extraglobs = None
示例13: configure
# 需要导入模块: from nose.plugins import Plugin [as 别名]
# 或者: from nose.plugins.Plugin import configure [as 别名]
def configure(self, options, conf):
self.hash_file = os.path.join(conf.workingDir, self.hash_file)
if os.path.isfile(self.hash_file):
log.debug("Loading last known hashes and dependency graph")
f = open(self.hash_file, 'r')
data = load(f)
f.close()
self._known_hashes = data['hashes']
self._known_graph = data['graph']
Plugin.configure(self, options, conf)
示例14: configure
# 需要导入模块: from nose.plugins import Plugin [as 别名]
# 或者: from nose.plugins.Plugin import configure [as 别名]
def configure(self, options, conf):
Plugin.configure(self, options, conf)
import testing, requires
testing.db = db
testing.requires = requires
# Lazy setup of other options (post coverage)
for fn in post_configure:
fn(options, file_config)
示例15: configure
# 需要导入模块: from nose.plugins import Plugin [as 别名]
# 或者: from nose.plugins.Plugin import configure [as 别名]
def configure(self, options, conf):
Plugin.configure(self, options, conf)
self.stream = None
self.enabled = True
self.has_failed_tests = False
self.good_tests = [ ]
self.function_calls = { }
self.calls = { }
self.app_paths = filter(bool, map(normalize_path, options.mutant_path or [ ]))
self.exclude_paths = filter(bool, map(normalize_path, options.mutant_exclude or [ ]))