17 is_string, normalize, py2to3, unicode)
19 from .tags
import TagPattern
44 exclude_empty=True, values_as_strings=False,
46 attrs = {
'pass': self.
passedpassed,
'fail': self.
failedfailed}
49 attrs[
'label'] = self.
namename
54 attrs =
dict((k, v)
for k, v
in attrs.items()
if v
not in (
'',
None))
56 attrs =
dict((k,
unicode(v
if v
is not None else ''))
57 for k, v
in attrs.items())
59 attrs =
dict((k, self.
_html_escape_html_escape(v))
for k, v
in attrs.items())
85 self.
elapsedelapsed += test.elapsedtime
94 return not self.
failedfailed
97 visitor.visit_stat(self)
110 Stat.__init__(self, suite.longname)
119 return {
'id': self.
idid,
'name': self.
_name_name}
125 self.passed += other.passed
126 self.failed += other.failed
133 def __init__(self, name, doc='', links=None, critical=False,
134 non_critical=False, combined=None):
135 Stat.__init__(self, name)
159 return 'non-critical'
169 return ':::'.join(
'%s:%s' % (title, url)
for url, title
in self.
linkslinks)
183 def __init__(self, pattern, name=None, doc='', links=None):
184 TagStat.__init__(self, name
or pattern, doc, links, combined=pattern)
193 def __init__(self, tag_pattern, name=None, critical=True, doc='',
195 TagStat.__init__(self, name
or unicode(tag_pattern), doc, links,
196 critical=critical, non_critical=
not critical)
Generic statistic object used for storing all the statistic values.
def _update_elapsed(self, test)
def _html_escape(self, item)
def _get_custom_attrs(self)
def _update_stats(self, test)
def get_attributes(self, include_label=False, include_elapsed=False, exclude_empty=True, values_as_strings=False, html_escape=False)
Stores statistics values for a single suite.
def __init__(self, suite)
def _get_custom_attrs(self)
def add_stat(self, other)
def _update_elapsed(self, test)
Stores statistic values for a test run.
unicode
Exceptions and return codes used internally.
def html_escape(text, linkify=True)
def normalize(string, ignore=(), caseless=True, spaceless=True)
Normalizes given string according to given spec.
def elapsed_time_to_string(elapsed, include_millis=True)
Converts elapsed time in milliseconds to format 'hh:mm:ss.mil'.