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


Python nose.__version__方法代码示例

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


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

示例1: parseArgs

# 需要导入模块: import nose [as 别名]
# 或者: from nose import __version__ [as 别名]
def parseArgs(self, argv):
        """Parse argv and env and configure running environment.
        """
        self.config.configure(argv, doc=self.usage())
        log.debug("configured %s", self.config)

        # quick outs: version, plugins (optparse would have already
        # caught and exited on help)
        if self.config.options.version:
            from nose import __version__
            sys.stdout = sys.__stdout__
            print "%s version %s" % (os.path.basename(sys.argv[0]), __version__)
            sys.exit(0)

        if self.config.options.showPlugins:
            self.showPlugins()
            sys.exit(0)

        if self.testLoader is None:
            self.testLoader = defaultTestLoader(config=self.config)
        elif isclass(self.testLoader):
            self.testLoader = self.testLoader(config=self.config)
        plug_loader = self.config.plugins.prepareTestLoader(self.testLoader)
        if plug_loader is not None:
            self.testLoader = plug_loader
        log.debug("test loader is %s", self.testLoader)

        # FIXME if self.module is a string, add it to self.testNames? not sure

        if self.config.testNames:
            self.testNames = self.config.testNames
        else:
            self.testNames = tolist(self.defaultTest)
        log.debug('defaultTest %s', self.defaultTest)
        log.debug('Test names are %s', self.testNames)
        if self.config.workingDir is not None:
            os.chdir(self.config.workingDir)
        self.createTests() 
开发者ID:singhj,项目名称:locality-sensitive-hashing,代码行数:40,代码来源:core.py

示例2: get_versions

# 需要导入模块: import nose [as 别名]
# 或者: from nose import __version__ [as 别名]
def get_versions(self):
        """Return versions of framework and its plugins."""
        import nose
        from pkg_resources import iter_entry_points

        versions = ['nose {}'.format(nose.__version__)]

        for entry_point, _ in (nose.plugins.manager.EntryPointPluginManager
                               .entry_points):
            for ep in iter_entry_points(entry_point):
                versions.append(
                    "   {} {}".format(ep.dist.project_name, ep.dist.version))
        return versions 
开发者ID:spyder-ide,项目名称:spyder-unittest,代码行数:15,代码来源:noserunner.py

示例3: check_dependencies

# 需要导入模块: import nose [as 别名]
# 或者: from nose import __version__ [as 别名]
def check_dependencies(self):
        try:
            import nose
            self.logger.debug("\tNose: %s\n" % str(nose.__version__))
        except ImportError:
            raise ImportError("Nose cannot be imported. Are you sure it's "
                              "installed?")
        try:
            import networkx
            self.logger.debug("\tnetworkx: %s\n" % str(networkx.__version__))
        except ImportError:
            raise ImportError("Networkx cannot be imported. Are you sure it's "
                              "installed?")
        try:
            import pymongo
            self.logger.debug("\tpymongo: %s\n" % str(pymongo.version))
            from bson.objectid import ObjectId
        except ImportError:
            raise ImportError("Pymongo cannot be imported. Are you sure it's"
                              " installed?")
        try:
            import numpy
            self.logger.debug("\tnumpy: %s" % str(numpy.__version__))
        except ImportError:
            raise ImportError("Numpy cannot be imported. Are you sure that it's"
                              " installed?")
        try:
            import scipy
            self.logger.debug("\tscipy: %s" % str(scipy.__version__))
        except ImportError:
            raise ImportError("Scipy cannot be imported. Are you sure that it's"
                              " installed?") 
开发者ID:automl,项目名称:HPOlib,代码行数:34,代码来源:random_hyperopt_august2013_mod.py


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