Creating a unittest TestRunner
Edward Diener
eldiener at earthlink.net
Sat Sep 4 20:41:01 EDT 2004
More information about the Python-list mailing list
Sat Sep 4 20:41:01 EDT 2004
- Previous message (by thread): Could somebody tell where to find the dynlib and dev headers for Python on Mac X OS
- Next message (by thread): Is it possible?: cat text.txt | python_script_which_also_gets_user_input.py
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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.
- Previous message (by thread): Could somebody tell where to find the dynlib and dev headers for Python on Mac X OS
- Next message (by thread): Is it possible?: cat text.txt | python_script_which_also_gets_user_input.py
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list