当前位置: 首页>>代码示例>>Python>>正文


Python Plugin.options方法代码示例

本文整理汇总了Python中nose.plugins.Plugin.options方法的典型用法代码示例。如果您正苦于以下问题:Python Plugin.options方法的具体用法?Python Plugin.options怎么用?Python Plugin.options使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在nose.plugins.Plugin的用法示例。


在下文中一共展示了Plugin.options方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: configure

# 需要导入模块: from nose.plugins import Plugin [as 别名]
# 或者: from nose.plugins.Plugin import options [as 别名]
def configure(self, options, conf):
        """Configure plugin.
        """
        Plugin.configure(self, options, conf)
        if options.failed:
            self.enabled = True
            self.loopOnFailed = True
            log.debug("Looping on failed tests")
        self.idfile = os.path.expanduser(options.testIdFile)
        if not os.path.isabs(self.idfile):
            self.idfile = os.path.join(conf.workingDir, self.idfile)
        self.id = 1
        # Ids and tests are mirror images: ids are {id: test address} and
        # tests are {test address: id}
        self.ids = {}
        self.tests = {}
        self.failed = []
        self.source_names = []
        # used to track ids seen when tests is filled from
        # loaded ids file
        self._seen = {}
        self._write_hashes = conf.verbosity >= 2 
开发者ID:singhj,项目名称:locality-sensitive-hashing,代码行数:24,代码来源:testid.py

示例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('--doctest-tests', action='store_true',
                          dest='doctest_tests',
                          default=env.get('NOSE_DOCTEST_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_DOCTEST_TESTS]")
        parser.add_option('--doctest-extension', action="append",
                          dest="doctestExtension",
                          help="Also look for doctests in files with "
                          "this extension [NOSE_DOCTEST_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_DOCTEST_EXTENSION')
        if env_setting is not None:
            parser.set_defaults(doctestExtension=tolist(env_setting)) 
开发者ID:ktraunmueller,项目名称:Computable,代码行数:21,代码来源:ipdoctest.py

示例3: makeTest

# 需要导入模块: from nose.plugins import Plugin [as 别名]
# 或者: from nose.plugins.Plugin import options [as 别名]
def makeTest(self, obj, parent):
        """Look for doctests in the given object, which will be a
        function, method or class.
        """
        #print 'Plugin analyzing:', obj, parent  # dbg
        # always use whitespace and ellipsis options
        optionflags = doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS

        doctests = self.finder.find(obj, module=getmodule(parent))
        if doctests:
            for test in doctests:
                if len(test.examples) == 0:
                    continue

                yield DocTestCase(test, obj=obj,
                                  optionflags=optionflags,
                                  checker=self.checker) 
开发者ID:ktraunmueller,项目名称:Computable,代码行数:19,代码来源:ipdoctest.py

示例4: 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]") 
开发者ID:ionelmc,项目名称:nose-htmloutput,代码行数:12,代码来源:__init__.py

示例5: configure

# 需要导入模块: from nose.plugins import Plugin [as 别名]
# 或者: from nose.plugins.Plugin import options [as 别名]
def configure(self, options, config):
        """Configures the xunit plugin."""
        Plugin.configure(self, options, config)
        self.config = config
        if self.enabled:
            self.jinja = Environment(
                loader=FileSystemLoader(os.path.join(os.path.dirname(__file__), 'templates')),
                trim_blocks=True,
                lstrip_blocks=True
            )
            self.stats = {'errors': 0, 'failures': 0, 'passes': 0, 'skipped': 0}
            self.report_data = defaultdict(Group)
            self.report_file = codecs.open(options.html_file, 'w', self.encoding, 'replace') 
开发者ID:ionelmc,项目名称:nose-htmloutput,代码行数:15,代码来源:__init__.py

示例6: 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)
        opt = parser.add_option

        def make_option(name, **kw):
            callback_ = kw.pop("callback", None)
            if callback_:
                def wrap_(option, opt_str, value, parser):
                    callback_(opt_str, value, parser)
                kw["callback"] = wrap_
            opt(name, **kw)

        plugin_base.setup_options(make_option)
        plugin_base.read_config() 
开发者ID:jpush,项目名称:jbox,代码行数:16,代码来源:noseplugin.py

示例7: configure

# 需要导入模块: from nose.plugins import Plugin [as 别名]
# 或者: from nose.plugins.Plugin import options [as 别名]
def configure(self, options, conf):
        super(NoseSQLAlchemy, self).configure(options, conf)
        plugin_base.pre_begin(options)

        plugin_base.set_coverage_flag(options.enable_plugin_coverage)

        plugin_base.set_skip_test(nose.SkipTest) 
开发者ID:jpush,项目名称:jbox,代码行数:9,代码来源:noseplugin.py

示例8: configure

# 需要导入模块: from nose.plugins import Plugin [as 别名]
# 或者: from nose.plugins.Plugin import options [as 别名]
def configure(self, options, conf):
        super(NoseSQLAlchemy, self).configure(options, conf)
        plugin_base.pre_begin(options)

        plugin_base.set_coverage_flag(options.enable_plugin_coverage) 
开发者ID:jpush,项目名称:jbox,代码行数:7,代码来源:noseplugin.py

示例9: 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('--id-file', action='store', dest='testIdFile',
                          default='.noseids', metavar="FILE",
                          help="Store test ids found in test runs in this "
                          "file. Default is the file .noseids in the "
                          "working directory.")
        parser.add_option('--failed', action='store_true',
                          dest='failed', default=False,
                          help="Run the tests that failed in the last "
                          "test run.") 
开发者ID:singhj,项目名称:locality-sensitive-hashing,代码行数:15,代码来源:testid.py

示例10: __init__

# 需要导入模块: from nose.plugins import Plugin [as 别名]
# 或者: from nose.plugins.Plugin import options [as 别名]
def __init__(self, source, want, exc_msg=None, lineno=0, indent=0,
                 options=None):
        # Parent constructor
        doctest.Example.__init__(self,source,want,exc_msg,lineno,indent,options)

        # An EXTRA newline is needed to prevent pexpect hangs
        self.source += '\n' 
开发者ID:ktraunmueller,项目名称:Computable,代码行数:9,代码来源:ipdoctest.py

示例11: configure

# 需要导入模块: from nose.plugins import Plugin [as 别名]
# 或者: from nose.plugins.Plugin import options [as 别名]
def configure(self, options, config):
        Plugin.configure(self, options, config)
        # Pull standard doctest plugin out of config; we will do doctesting
        config.plugins.plugins = [p for p in config.plugins.plugins
                                  if p.name != 'doctest']
        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 
开发者ID:ktraunmueller,项目名称:Computable,代码行数:15,代码来源:ipdoctest.py

示例12: loadTestsFromModule

# 需要导入模块: from nose.plugins import Plugin [as 别名]
# 或者: from nose.plugins.Plugin import options [as 别名]
def loadTestsFromModule(self, module):
        #print '*** ipdoctest - lTM',module  # dbg

        if not self.matches(module.__name__):
            log.debug("Doctest doesn't want module %s", module)
            return

        tests = self.finder.find(module,globs=self.globs,
                                 extraglobs=self.extraglobs)
        if not tests:
            return

        # always use whitespace and ellipsis options
        optionflags = doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS

        tests.sort()
        module_file = module.__file__
        if module_file[-4:] in ('.pyc', '.pyo'):
            module_file = module_file[:-1]
        for test in tests:
            if not test.examples:
                continue
            if not test.filename:
                test.filename = module_file

            yield DocTestCase(test,
                              optionflags=optionflags,
                              checker=self.checker) 
开发者ID:ktraunmueller,项目名称:Computable,代码行数:30,代码来源:ipdoctest.py

示例13: 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)
        opt = parser.add_option

        def make_option(name, **kw):
            callback_ = kw.pop("callback", None) or kw.pop("zeroarg_callback", None)
            if callback_:
                def wrap_(option, opt_str, value, parser):
                    callback_(opt_str, value, parser)
                kw["callback"] = wrap_
            opt(name, **kw)

        plugin_base.setup_options(make_option)
        plugin_base.read_config() 
开发者ID:yfauser,项目名称:planespotter,代码行数:16,代码来源:noseplugin.py

示例14: configure

# 需要导入模块: from nose.plugins import Plugin [as 别名]
# 或者: from nose.plugins.Plugin import options [as 别名]
def configure(self, options, conf):
        super(NoseSQLAlchemy, self).configure(options, conf)
        plugin_base.pre_begin(options)

        plugin_base.set_coverage_flag(options.enable_plugin_coverage)

        global fixtures
        from sqlalchemy.testing import fixtures  # noqa 
开发者ID:gltn,项目名称:stdm,代码行数:10,代码来源:noseplugin.py

示例15: configure

# 需要导入模块: from nose.plugins import Plugin [as 别名]
# 或者: from nose.plugins.Plugin import options [as 别名]
def configure(self, options, conf):
        super(NoseSQLAlchemy, self).configure(options, conf)
        plugin_base.pre_begin(options)

        plugin_base.set_coverage_flag(options.enable_plugin_coverage)

        global fixtures
        from sqlalchemy.testing import fixtures 
开发者ID:binhex,项目名称:moviegrabber,代码行数:10,代码来源:noseplugin.py


注:本文中的nose.plugins.Plugin.options方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。