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


Python TextTestRunner.__init__方法代码示例

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


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

示例1: __init__

# 需要导入模块: from unittest import TextTestRunner [as 别名]
# 或者: from unittest.TextTestRunner import __init__ [as 别名]
 def __init__(self, output='.', stream=sys.stderr, descriptions=True, \
     verbose=False, elapsed_times=True):
     "Create a new instance of XMLTestRunner."
     verbosity = (1, 2)[verbose]
     TextTestRunner.__init__(self, stream, descriptions, verbosity)
     self.output = output
     self.elapsed_times = elapsed_times
开发者ID:garsue,项目名称:unittest-xml-reporting,代码行数:9,代码来源:__init__.py

示例2: __init__

# 需要导入模块: from unittest import TextTestRunner [as 别名]
# 或者: from unittest.TextTestRunner import __init__ [as 别名]
    def __init__(self, output="./reports/", verbosity=2, stream=sys.stderr,
                 descriptions=True, failfast=False, buffer=False,
                 report_title=None, report_name=None, template=None, resultclass=None,
                 add_timestamp=True, open_in_browser=False,
                 combine_reports=False, template_args=None):
        self.verbosity = verbosity
        self.output = output
        self.encoding = UTF8

        TextTestRunner.__init__(self, stream, descriptions, verbosity,
                                failfast=failfast, buffer=buffer)

        if add_timestamp:
            self.timestamp = time.strftime(self.time_format)
        else:
            self.timestamp = ""

        if resultclass is None:
            self.resultclass = HtmlTestResult
        else:
            self.resultclass = resultclass

        if template_args is not None and not isinstance(template_args, dict):
            raise ValueError("template_args must be a dict-like.")
        self.template_args = template_args or {}

        self.report_title = report_title or "Unittest Results"
        self.report_name = report_name
        self.template = template

        self.open_in_browser = open_in_browser
        self.combine_reports = combine_reports

        self.start_time = 0
        self.time_taken = 0
开发者ID:oldani,项目名称:HtmlTestRunner,代码行数:37,代码来源:runner.py

示例3: __init__

# 需要导入模块: from unittest import TextTestRunner [as 别名]
# 或者: from unittest.TextTestRunner import __init__ [as 别名]
 def __init__(self, comm=None, stream=sys.stderr, **kwargs):
     if comm is None:
         comm = world
     self.comm = comm
     if self.comm.rank != 0:
         stream = devnull
     elif type(stream) is str:
         self.logfile = stream
         stream = open(self.logfile, 'w', buffering=0)
     TextTestRunner.__init__(self, stream=stream, **kwargs)
开发者ID:eojons,项目名称:gpaw-scme,代码行数:12,代码来源:parunittest.py

示例4: __init__

# 需要导入模块: from unittest import TextTestRunner [as 别名]
# 或者: from unittest.TextTestRunner import __init__ [as 别名]
 def __init__(self, output='.', outsuffix=None, stream=sys.stderr,
              descriptions=True, verbosity=1, elapsed_times=True):
     TextTestRunner.__init__(self, stream, descriptions, verbosity)
     self.verbosity = verbosity
     self.output = output
     if outsuffix:
         self.outsuffix = outsuffix
     else:
         self.outsuffix = time.strftime("%Y%m%d%H%M%S")
     self.elapsed_times = elapsed_times
开发者ID:Work4Labs,项目名称:selenium-simple-test,代码行数:12,代码来源:junitxmlrunner.py

示例5: __init__

# 需要导入模块: from unittest import TextTestRunner [as 别名]
# 或者: from unittest.TextTestRunner import __init__ [as 别名]
    def __init__(self, output, verbosity=2, stream=sys.stderr,
                 descriptions=True, failfast=False, buffer=False,
                 report_title=None, template=None, resultclass=None):
        self.verbosity = verbosity
        self.output = output
        self.encoding = UTF8

        TextTestRunner.__init__(self, stream, descriptions, verbosity,
                                failfast=failfast, buffer=buffer)

        self.outsuffix = time.strftime("%Y-%m-%d_%H-%M-%S")
        self.elapsed_times = True
        if resultclass is None:
            self.resultclass = _HtmlTestResult
        else:
            self.resultclass = resultclass

        self.report_title = report_title or "Test Result"
        self.template = template
开发者ID:LukasLewandowski,项目名称:HtmlTestRunner,代码行数:21,代码来源:runner.py

示例6: __init__

# 需要导入模块: from unittest import TextTestRunner [as 别名]
# 或者: from unittest.TextTestRunner import __init__ [as 别名]
 def __init__(self, database_path, runid, module_name, stream=sys.stderr, descriptions=1, verbosity=1):
     self.database_path = database_path
     self.runid = runid
     self.module_name = module_name
     TextTestRunner.__init__(self, stream=stream, descriptions=descriptions, verbosity=verbosity)
开发者ID:alexstoick,项目名称:ruby_tests,代码行数:7,代码来源:testrunner.py

示例7: __init__

# 需要导入模块: from unittest import TextTestRunner [as 别名]
# 或者: from unittest.TextTestRunner import __init__ [as 别名]
 def __init__(self, stream=sys.stdout, xml_stream=None):
     TextTestRunner.__init__(self, stream, descriptions=0, verbosity=2)
     self.xml_stream = xml_stream
开发者ID:blaxter,项目名称:Bitten,代码行数:5,代码来源:testrunner.py

示例8: __init__

# 需要导入模块: from unittest import TextTestRunner [as 别名]
# 或者: from unittest.TextTestRunner import __init__ [as 别名]
 def __init__(self, stream=sys.stderr, descriptions=True, verbosity=1):
     TextTestRunner.__init__(self, stream, descriptions, verbosity)
开发者ID:InCNTRE,项目名称:oftest,代码行数:4,代码来源:conformance_test.py

示例9: __init__

# 需要导入模块: from unittest import TextTestRunner [as 别名]
# 或者: from unittest.TextTestRunner import __init__ [as 别名]
 def __init__(self, output=".", stream=sys.stderr, descriptions=True, verbose=1, elapsed_times=True):
     "Create a new instance of XMLTestRunner."
     verbosity = verbose
     TextTestRunner.__init__(self, stream, descriptions, verbosity)
     self.output = output
     self.elapsed_times = elapsed_times
开发者ID:d1ffuz0r,项目名称:pkg-python-xmlrunner,代码行数:8,代码来源:__init__.py

示例10: __init__

# 需要导入模块: from unittest import TextTestRunner [as 别名]
# 或者: from unittest.TextTestRunner import __init__ [as 别名]
 def __init__(self):
     self.all_suites = {}
     TextTestRunner.__init__(self)
开发者ID:jboner,项目名称:emacs-config,代码行数:5,代码来源:unit_testing.py


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