本文整理汇总了Python中unittest.TestResult.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python TestResult.__init__方法的具体用法?Python TestResult.__init__怎么用?Python TestResult.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类unittest.TestResult
的用法示例。
在下文中一共展示了TestResult.__init__方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from unittest import TestResult [as 别名]
# 或者: from unittest.TestResult import __init__ [as 别名]
def __init__(self):
TestResult.__init__(self)
self.start_at = time.time()
self.testSuccess = []
self.all_tests = {}
self.results_log = {}
self.note_log = []
示例2: __init__
# 需要导入模块: from unittest import TestResult [as 别名]
# 或者: from unittest.TestResult import __init__ [as 别名]
def __init__(self, stream=sys.stdout, *args, **kwargs):
TestResult.__init__(self)
for arg, value in kwargs.items():
setattr(self, arg, value)
self.output = stream
self.messages = TeamcityServiceMessages(self.output, prepend_linebreak=True)
self.messages.testMatrixEntered()
self.current_suite = None
示例3: __init__
# 需要导入模块: from unittest import TestResult [as 别名]
# 或者: from unittest.TestResult import __init__ [as 别名]
def __init__(self, comm=None):
if comm is None:
comm = world
self.comm = comm
self.outcomes = []
self.last_errors = np.empty(self.comm.size, dtype=bool)
self.last_failed = np.empty(self.comm.size, dtype=bool)
TestResult.__init__(self)
示例4: __init__
# 需要导入模块: from unittest import TestResult [as 别名]
# 或者: from unittest.TestResult import __init__ [as 别名]
def __init__(self, stream=sys.stdout):
TestResult.__init__(self)
self.output = stream
self.test_started_datetime = None
self.test_name = None
self.createMessages()
示例5: __init__
# 需要导入模块: from unittest import TestResult [as 别名]
# 或者: from unittest.TestResult import __init__ [as 别名]
def __init__(self, parent):
"""
Constructor
@param parent The parent widget.
"""
TestResult.__init__(self)
self.parent = parent
示例6: __init__
# 需要导入模块: from unittest import TestResult [as 别名]
# 或者: from unittest.TestResult import __init__ [as 别名]
def __init__(self, stream, descriptions, verbosity):
TestResult.__init__(self)
self.stream = _WritelnDecorator(stream)
self.showAll = verbosity > 1
self.descriptions = descriptions
self._lastWas = 'success'
self._errorsAndFailures = ""
self._startTime = 0.0
self.params=""
示例7: __init__
# 需要导入模块: from unittest import TestResult [as 别名]
# 或者: from unittest.TestResult import __init__ [as 别名]
def __init__(self, xml, descriptions, verbosity):
TestResult.__init__(self)
self.xml = xml
self.showAll = verbosity > 1
self.dots = verbosity == 1
self.descriptions = descriptions
self._testsuites = {}
self._testsuite_xml = None
self._testcase_xml = None
示例8: __init__
# 需要导入模块: from unittest import TestResult [as 别名]
# 或者: from unittest.TestResult import __init__ [as 别名]
def __init__(self):
buildstep.LogLineObserver.__init__(self)
TestResult.__init__(self)
try:
from subunit import TestProtocolServer
except ImportError:
raise ImportError("subunit is not importable, but is required for "
"SubunitLogObserver support.")
self.protocol = TestProtocolServer(self, DiscardStream())
示例9: __init__
# 需要导入模块: from unittest import TestResult [as 别名]
# 或者: from unittest.TestResult import __init__ [as 别名]
def __init__(self, result):
"""Constructor.
@param result: TestResult The wrapped object
"""
assert isinstance(result, TestResult);
TestResult.__init__(self);
self._result = result;
示例10: __init__
# 需要导入模块: from unittest import TestResult [as 别名]
# 或者: from unittest.TestResult import __init__ [as 别名]
def __init__(self):
buildstep.LogLineObserver.__init__(self)
TestResult.__init__(self)
try:
from subunit import TestProtocolServer
except ImportError:
raise ImportError("subunit is not importable, but is required for " "SubunitLogObserver support.")
self.warningio = StringIO()
self.protocol = TestProtocolServer(self, self.warningio)
self.skips = []
self.seen_tags = set() # don't yet know what tags does in subunit
示例11: __init__
# 需要导入模块: from unittest import TestResult [as 别名]
# 或者: from unittest.TestResult import __init__ [as 别名]
def __init__(self, stream=sys.stdout, *args, **kwargs):
TestResult.__init__(self)
for arg, value in kwargs.items():
setattr(self, arg, value)
self.output = stream
self.messages = TeamcityServiceMessages(self.output, prepend_linebreak=True)
if not "_jb_do_not_call_enter_matrix" in os.environ:
self.messages.testMatrixEntered()
self.current_failed = False
self.current_suite = None
self.subtest_suite = None
示例12: __init__
# 需要导入模块: from unittest import TestResult [as 别名]
# 或者: from unittest.TestResult import __init__ [as 别名]
def __init__(self):
logobserver.LogLineObserver.__init__(self)
TestResult.__init__(self)
try:
from subunit import TestProtocolServer, PROGRESS_CUR, PROGRESS_SET
from subunit import PROGRESS_PUSH, PROGRESS_POP
except ImportError:
raise ImportError("subunit is not importable, but is required for "
"SubunitLogObserver support.")
self.PROGRESS_CUR = PROGRESS_CUR
self.PROGRESS_SET = PROGRESS_SET
self.PROGRESS_PUSH = PROGRESS_PUSH
self.PROGRESS_POP = PROGRESS_POP
self.warningio = StringIO()
self.protocol = TestProtocolServer(self, self.warningio)
self.skips = []
self.seen_tags = set() # don't yet know what tags does in subunit
示例13: __init__
# 需要导入模块: from unittest import TestResult [as 别名]
# 或者: from unittest.TestResult import __init__ [as 别名]
def __init__(self, verbosity=1):
TestResult.__init__(self)
self.outputBuffer = StringIO()
self.stdout0 = None
self.stderr0 = None
self.success_count = 0
self.skip_count = 0
self.failure_count = 0
self.error_count = 0
self.verbosity = verbosity
# result is a list of result in 4 tuple
# (
# result code (0: success; 1: fail; 2: error),
# TestCase object,
# Test output (byte string),
# stack trace,
# )
self.result = []
示例14: __init__
# 需要导入模块: from unittest import TestResult [as 别名]
# 或者: from unittest.TestResult import __init__ [as 别名]
def __init__(self, status=None, on_success=None, on_failure=None,
reset=None):
TestResult.__init__(self)
QtGui.QWidget.__init__(self)
self.status = status
self.on_success = on_success
self.on_failure = on_failure
self.reset = reset
self.progress = QtGui.QProgressBar(self)
if COLORED_PROGRESS:
self.setProgressColor(BLUE_COLOR)
self.success = QtGui.QListWidget(self)
self.fail = QtGui.QListWidget(self)
self.error = QtGui.QListWidget(self)
self.success_data = []
self.fail_data = []
self.error_data = []
self.views = []
self.n_success = 0
self.n_fail = 0
self.n_error = 0
left = QtGui.QVBoxLayout()
left.addWidget(QtGui.QLabel('Passed Tests:'))
left.addWidget(self.success)
left.addWidget(self.progress)
right = QtGui.QVBoxLayout()
right.addWidget(QtGui.QLabel('Tests with Errors:'))
right.addWidget(self.error)
right.addWidget(QtGui.QLabel('Failed Tests:'))
right.addWidget(self.fail)
main = QtGui.QHBoxLayout()
main.addLayout(left)
main.addLayout(right)
self.setLayout(main)
self.connect(
self.success,
QtCore.SIGNAL("itemDoubleClicked ( QListWidgetItem * )"),
self.successItemDoubleClicked
)
self.connect(
self.fail,
QtCore.SIGNAL("itemDoubleClicked ( QListWidgetItem * )"),
self.failureItemDoubleClicked
)
self.connect(
self.error,
QtCore.SIGNAL("itemDoubleClicked ( QListWidgetItem * )"),
self.errorItemDoubleClicked
)
self.translate = {
'success': self.addSuccess,'failure': self.addFailure,
'error': self.addError, 'start': self.startTest,
'done': self.done
}
示例15: __init__
# 需要导入模块: from unittest import TestResult [as 别名]
# 或者: from unittest.TestResult import __init__ [as 别名]
def __init__(self, stream=stdout, errStream=stderr, verbosity=1):
UnitTestResult.__init__(self)
self.showAll = verbosity > 1
self.dots = verbosity == 1
self._errStream = errStream
self._stream = stream