__author__ = "Steve Purcell"
__email__ = "stephen_purcell at yahoo dot com"
-__version__ = "#Revision: 1.45 $"[11:-2]
+__version__ = "#Revision: 1.46 $"[11:-2]
import time
import sys
# All classes defined herein are 'new-style' classes, allowing use of 'super()'
__metaclass__ = type
+def _strclass(cls):
+ return "%s.%s" % (cls.__module__, cls.__name__)
+
class TestResult:
"""Holder for test result information.
def __repr__(self):
return "<%s run=%i errors=%i failures=%i>" % \
- (self.__class__, self.testsRun, len(self.errors),
+ (_strclass(self.__class__), self.testsRun, len(self.errors),
len(self.failures))
return doc and string.strip(string.split(doc, "\n")[0]) or None
def id(self):
- return "%s.%s" % (self.__class__, self.__testMethodName)
+ return "%s.%s" % (_strclass(self.__class__), self.__testMethodName)
def __str__(self):
return "%s (%s)" % (self.__testMethodName, self.__class__)
def __repr__(self):
return "<%s testMethod=%s>" % \
- (self.__class__, self.__testMethodName)
+ (_strclass(self.__class__), self.__testMethodName)
def run(self, result=None):
return self(result)
self.addTests(tests)
def __repr__(self):
- return "<%s tests=%s>" % (self.__class__, self._tests)
+ return "<%s tests=%s>" % (_strclass(self.__class__), self._tests)
__str__ = __repr__
return self.__testFunc.__name__
def __str__(self):
- return "%s (%s)" % (self.__class__, self.__testFunc.__name__)
+ return "%s (%s)" % (_strclass(self.__class__), self.__testFunc.__name__)
def __repr__(self):
- return "<%s testFunc=%s>" % (self.__class__, self.__testFunc)
+ return "<%s testFunc=%s>" % (_strclass(self.__class__), self.__testFunc)
def shortDescription(self):
if self.__description is not None: return self.__description