<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1106" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial><PRE>Hi,</PRE><PRE>I Need Clear Explanaiation of this below code...Bcos my requirement is similar to the below code</PRE><PRE>I found this code example code in this link <A href="http://www.python.org/doc/lib/unittest-error-info.html">http://www.python.org/doc/lib/unittest-error-info.html</A></PRE><PRE>runner is not returning the MyTestResult class object, instead it is returning the TestResult Class object.</PRE><PRE> </PRE><PRE>import unittest

class MyTestCase(unittest.TestCase):
    def defaultTestResult(self):
        return MyTestResult()

class MyTestResult(unittest.TestResult):
    def __init__(self):
        self.errors_tb = []
        self.failures_tb = []

    def addError(self, test, err):
        self.errors_tb.append((test, err))
        unittest.TestResult.addError(self, test, err)

    def addFailure(self, test, err):
        self.failures_tb.append((test, err))
        unittest.TestResult.addFailure(self, test, err)
</PRE><PRE>suite = unittest.TestSuite()<BR>suite.addTest(unittest.makeSuite(MyTestCase))<BR>result = unittest.TextTestRunner(verbosity=2).run(suite)<BR></PRE><PRE>if you run this code,defaultTestResult(self) method not get called....</PRE><PRE> </PRE><PRE>Pls tell me how to extract the error information from MyTestResult class</PRE><PRE> </PRE><PRE>I will be thankfull to you...if u give a solution for the above problem.</PRE><PRE>Regards</PRE><PRE>Bala</PRE><PRE> </PRE></FONT></DIV></BODY></HTML>