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


Python depends.get_module_constant方法代码示例

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


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

示例1: testModuleExtract

# 需要导入模块: from setuptools import depends [as 别名]
# 或者: from setuptools.depends import get_module_constant [as 别名]
def testModuleExtract(self):
        if not hasattr(dep, 'get_module_constant'):
            # skip on non-bytecode platforms
            return

        from email import __version__
        self.assertEqual(
            dep.get_module_constant('email','__version__'), __version__
        )
        self.assertEqual(
            dep.get_module_constant('sys','version'), sys.version
        )
        self.assertEqual(
            dep.get_module_constant('setuptools.tests','__doc__'),__doc__
        ) 
开发者ID:MayOneUS,项目名称:pledgeservice,代码行数:17,代码来源:__init__.py

示例2: test_basic

# 需要导入模块: from setuptools import depends [as 别名]
# 或者: from setuptools.depends import get_module_constant [as 别名]
def test_basic(self):
        """
        Invoke get_module_constant on a module in
        the test package.
        """
        mod_name = 'setuptools.tests.mod_with_constant'
        val = depends.get_module_constant(mod_name, 'value')
        assert val == 'three, sir!'
        assert 'setuptools.tests.mod_with_constant' not in sys.modules 
开发者ID:pypa,项目名称:setuptools,代码行数:11,代码来源:test_depends.py

示例3: testModuleExtract

# 需要导入模块: from setuptools import depends [as 别名]
# 或者: from setuptools.depends import get_module_constant [as 别名]
def testModuleExtract(self):
        from json import __version__
        assert dep.get_module_constant('json', '__version__') == __version__
        assert dep.get_module_constant('sys', 'version') == sys.version
        assert dep.get_module_constant(
            'setuptools.tests.test_setuptools', '__doc__') == __doc__ 
开发者ID:pypa,项目名称:setuptools,代码行数:8,代码来源:test_setuptools.py


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