Creating a unittest TestRunner

Discussion in 'Python' started by Edward Diener, Sep 5, 2004.

  1. I am interested in the ability to create a unit test TestRunner other than
    the default TextTestRunner provided in unittest. While the documentation
    explains:

    "A test runner is an object that provides a single method, run(), which
    accepts a TestCase or TestSuite object as a parameter, and returns a result
    object. The class TestResult is provided for use as the result object.
    PyUnit provide the TextTestRunner as an example test runner which reports
    test results on the standard error stream by default. Alternate runners can
    be implemented for other environments (such as graphical environments)
    without any need to derive from a specific class."

    I am having trouble imagining how an alternate TestRunner might work. Does
    the normal action of a TestRunner merely instantiate a TestResult object
    when its run() method is called and pass that to the instance of the
    TestSuite, which is passed to it, run() method for the test suite to fill in
    the result object as it runs ? Is there anything else that an alternate
    TestRunner needs to do in the minimal case ?

    The interactions between the TestRunner, TestSuite, and TestLoader are not
    exactly spelled out in detail, although the documentation for the latter two
    is adequate.
     
    Edward Diener, Sep 5, 2004
    #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. Paul  Moore
    Replies:
    1
    Views:
    385
    Paul Moore
    Oct 14, 2008
  2. Michael Neumann
    Replies:
    2
    Views:
    120
    Michael Neumann
    Nov 11, 2003
  3. Lucian Suciu
    Replies:
    4
    Views:
    121
    Lucian Suciu
    Nov 28, 2003
  4. Lucian Suciu
    Replies:
    3
    Views:
    100
    Lucian Suciu
    Nov 28, 2003
  5. Martin Ankerl

    colorized Test::Unit console testrunner

    Martin Ankerl, Sep 16, 2004, in forum: Ruby
    Replies:
    3
    Views:
    167
    Florian Gross
    Sep 16, 2004
Loading...

Share This Page