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


Python Plugin.add_options方法代码示例

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


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

示例1: add_options

# 需要导入模块: from nose.plugins.base import Plugin [as 别名]
# 或者: from nose.plugins.base.Plugin import add_options [as 别名]
 def add_options(self, parser, env=os.environ):
     Plugin.add_options(self, parser, env)
     parser.add_option("--cover-package", action="append",
                       default=env.get('NOSE_COVER_PACKAGE'),
                       dest="cover_packages",
                       help="Restrict coverage output to selected packages "
                       "[NOSE_COVER_PACKAGE]")
     parser.add_option("--cover-erase", action="store_true",
                       default=env.get('NOSE_COVER_ERASE'),
                       dest="cover_erase",
                       help="Erase previously collected coverage "
                       "statistics before run")
     parser.add_option("--cover-tests", action="store_true",
                       dest="cover_tests",
                       default=env.get('NOSE_COVER_TESTS'),
                       help="Include test modules in coverage report "
                       "[NOSE_COVER_TESTS]")
     parser.add_option("--cover-inclusive", action="store_true",
                       dest="cover_inclusive",
                       default=env.get('NOSE_COVER_INCLUSIVE'),
                       help="Include all python files under working "
                       "directory in coverage report.  Useful for "
                       "discovering holes in test coverage if not all "
                       "files are imported by the test suite. "
                       "[NOSE_COVER_INCLUSIVE]")
开发者ID:thraxil,项目名称:gtreed,代码行数:27,代码来源:cover.py

示例2: add_options

# 需要导入模块: from nose.plugins.base import Plugin [as 别名]
# 或者: from nose.plugins.base.Plugin import add_options [as 别名]
 def add_options(self, parser, env=os.environ):
     log.debug('Adding options on Bitten plug')
     Plugin.add_options(self, parser, env)
     parser.add_option(
         '--xml-results', action='store', dest='xml_results',
         metavar='FILE', help='write XML test results to FILE. Default: %default',
         default=os.path.join(os.getcwd(), 'build', 'test-results.xml')
     )
开发者ID:UfSoft,项目名称:trac-bitten-extra-nose,代码行数:10,代码来源:plugnose.py

示例3: add_options

# 需要导入模块: from nose.plugins.base import Plugin [as 别名]
# 或者: from nose.plugins.base.Plugin import add_options [as 别名]
 def add_options(self, parser, env=os.environ):
     Plugin.add_options(self, parser, env)
     parser.add_option("--faster-than",
                       action="store",
                       type="float",
                       dest="faster_than",
                       default=None,
                       help="Run only tests that are faster than FASTER_THAN seconds.")
     parser.add_option("--stopwatch-file",
                       action="store",
                       dest="stopwatch_file",
                       default=".nose-stopwatch-times",
                       help="Store test timing results in this file.")
开发者ID:Jaytanya,项目名称:pinocchio,代码行数:15,代码来源:stopwatch.py

示例4: options

# 需要导入模块: from nose.plugins.base import Plugin [as 别名]
# 或者: from nose.plugins.base.Plugin import add_options [as 别名]
 def options(self, parser, env=os.environ):
     Coverage.options(self, parser, env)
     Plugin.add_options(self, parser, env)
     parser.add_option(
         '--coverage-summary', action='store', dest='coverage_summary',
         metavar='FILE',
         help='write XML coverage results to FILE. Default: %default',
         default=os.path.join(os.getcwd(), 'build', 'coverage-results.txt'),
     )
     parser.add_option(
         '--cover-packages', action='store', dest='cover_packages',
         default=env.get('NOSE_COVER_PACKAGE'),
     )
开发者ID:hekevintran,项目名称:bittenextranose,代码行数:15,代码来源:plugnose.py

示例5: add_options

# 需要导入模块: from nose.plugins.base import Plugin [as 别名]
# 或者: from nose.plugins.base.Plugin import add_options [as 别名]
 def add_options(self, parser, env=os.environ):
     Plugin.add_options(self, parser, env)                
     parser.add_option('--profile-sort',action='store',dest='profile_sort',
                       default=env.get('NOSE_PROFILE_SORT','cumulative'),
                       help="Set sort order for profiler output")
     parser.add_option('--profile-stats-file',action='store',
                       dest='profile_stats_file',
                       default=env.get('NOSE_PROFILE_STATS_FILE'),
                       help='Profiler stats file; default is a new '
                       'temp file on each run')
     parser.add_option('--profile-restrict',action='append',
                       dest='profile_restrict',
                       default=env.get('NOSE_PROFILE_RESTRICT'),
                       help="Restrict profiler output. See help for "
                       "pstats.Stats for details")
开发者ID:thraxil,项目名称:gtreed,代码行数:17,代码来源:prof.py

示例6: add_options

# 需要导入模块: from nose.plugins.base import Plugin [as 别名]
# 或者: from nose.plugins.base.Plugin import add_options [as 别名]
 def add_options(self, parser, env=os.environ):
     Plugin.add_options(self, parser, env)
     parser.add_option('--doctest-tests', action='store_true',
                       dest='doctest_tests',
                       default=env.get('NOSE_DOCTEST_TESTS'),
                       help="Also look for doctests in test modules "
                       "[NOSE_DOCTEST_TESTS]")
     try:
         # 2.4 or better supports loading tests from non-modules
         doctest.DocFileSuite
         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))
     except AttributeError:
         pass
开发者ID:thraxil,项目名称:gtreed,代码行数:24,代码来源:doctests.py


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