How to use User Defined TestResult Class

Discussion in 'Python' started by bala, Dec 10, 2003.

  1. bala

    bala Guest

    Hi, I want to store the result in my Own TestResult(ie MyTestResult class).if i run the below testcase,defaultTestResult method not get called..My Requirement is If i run the TestCase, the Result should be stored in MyTestResult Class,i don't want to store in the TestResult class .....Pls give a Solution....With Some UserDefined TestResult class(Not UnitTesting Frame work TestResult Class)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)
    Regards,Bala
    bala, Dec 10, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. bala

    How to use TestResult Class

    bala, Dec 3, 2003, in forum: Python
    Replies:
    0
    Views:
    253
  2. bala
    Replies:
    0
    Views:
    255
  3. bala
    Replies:
    0
    Views:
    240
  4. Oodini
    Replies:
    1
    Views:
    1,751
    Keith Thompson
    Sep 27, 2005
  5. cgmjr

    Where is my TestResult?

    cgmjr, Dec 31, 2005, in forum: Ruby
    Replies:
    2
    Views:
    75
    cgmjr
    Dec 31, 2005
Loading...

Share This Page