@@ -46,7 +46,7 @@ def testMultiply(self):
4646
4747__author__ = "Steve Purcell"
4848__email__ = "stephen_purcell at yahoo dot com"
49- __version__ = "#Revision: 1.45 $" [11 :- 2 ]
49+ __version__ = "#Revision: 1.46 $" [11 :- 2 ]
5050
5151import time
5252import sys
@@ -62,6 +62,9 @@ def testMultiply(self):
6262# All classes defined herein are 'new-style' classes, allowing use of 'super()'
6363__metaclass__ = type
6464
65+ def _strclass (cls ):
66+ return "%s.%s" % (cls .__module__ , cls .__name__ )
67+
6568class TestResult :
6669 """Holder for test result information.
6770
@@ -116,7 +119,7 @@ def _exc_info_to_string(self, err):
116119
117120 def __repr__ (self ):
118121 return "<%s run=%i errors=%i failures=%i>" % \
119- (self .__class__ , self .testsRun , len (self .errors ),
122+ (_strclass ( self .__class__ ) , self .testsRun , len (self .errors ),
120123 len (self .failures ))
121124
122125
@@ -186,14 +189,14 @@ def shortDescription(self):
186189 return doc and string .strip (string .split (doc , "\n " )[0 ]) or None
187190
188191 def id (self ):
189- return "%s.%s" % (self .__class__ , self .__testMethodName )
192+ return "%s.%s" % (_strclass ( self .__class__ ) , self .__testMethodName )
190193
191194 def __str__ (self ):
192195 return "%s (%s)" % (self .__testMethodName , self .__class__ )
193196
194197 def __repr__ (self ):
195198 return "<%s testMethod=%s>" % \
196- (self .__class__ , self .__testMethodName )
199+ (_strclass ( self .__class__ ) , self .__testMethodName )
197200
198201 def run (self , result = None ):
199202 return self (result )
@@ -321,7 +324,7 @@ def __init__(self, tests=()):
321324 self .addTests (tests )
322325
323326 def __repr__ (self ):
324- return "<%s tests=%s>" % (self .__class__ , self ._tests )
327+ return "<%s tests=%s>" % (_strclass ( self .__class__ ) , self ._tests )
325328
326329 __str__ = __repr__
327330
@@ -385,10 +388,10 @@ def id(self):
385388 return self .__testFunc .__name__
386389
387390 def __str__ (self ):
388- return "%s (%s)" % (self .__class__ , self .__testFunc .__name__ )
391+ return "%s (%s)" % (_strclass ( self .__class__ ) , self .__testFunc .__name__ )
389392
390393 def __repr__ (self ):
391- return "<%s testFunc=%s>" % (self .__class__ , self .__testFunc )
394+ return "<%s testFunc=%s>" % (_strclass ( self .__class__ ) , self .__testFunc )
392395
393396 def shortDescription (self ):
394397 if self .__description is not None : return self .__description
0 commit comments