本文整理汇总了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
示例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
示例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)
示例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
示例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
示例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)
示例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
示例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)
示例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
示例10: __init__
# 需要导入模块: from unittest import TextTestRunner [as 别名]
# 或者: from unittest.TextTestRunner import __init__ [as 别名]
def __init__(self):
self.all_suites = {}
TextTestRunner.__init__(self)