[ python-Bugs-1681984 ] unittest documentation is incomplete
SourceForge.net
noreply at sourceforge.net
Mon Mar 19 03:00:41 CET 2007
Bugs item #1681984, was opened at 2007-03-16 11:17
Message generated for change (Comment added) made by haypo
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1681984&group_id=5470
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Documentation
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: STINNER Victor (haypo)
Assigned to: Nobody/Anonymous (nobody)
Summary: unittest documentation is incomplete
Initial Comment:
When I tried to write a test suite using many test cases, I read the documentation (docs.python.org) but it does work because I was unable to run my test suite. Using Google I realised that documentation is incomplete! In Python binding of gstreamer, I found a "TextTestRunner"!
So, would it be possible to update the doc?
----------------------------------------------------------------------
>Comment By: STINNER Victor (haypo)
Date: 2007-03-19 03:00
Message:
Logged In: YES
user_id=365388
Originator: YES
"Could you please state what exactly is missing from the documentation, in
your opinion?"
Well, when I ready Python documentation I expect to have the full list of
"builtin" modules, functions and classes. But if you check unittest module,
documentation only list TestCase, TestSuite, TestResult and TestLoader.
Whereas dir(unittest) gives TestCase, TestLoader, *TestProgram*,
TestResult, TestSuite, *TextTestRunner*.
So information about TestProgram and TextTestRunner is missing.
I also expect a small example showing how to use a test runner and a test
suite.
I'm using:
------------------------------ 8< -----------------------
from unittest import TestSuite, TestLoader, TextTestRunner
from sys import exit
def loadTests(loader):
"""Generator listing all test cases"""
...
def main():
loader = TestLoader()
suite = TestSuite()
for test in loadTests(loader.loadTestsFromTestCase):
suite.addTests(test)
runner = TextTestRunner(descriptions=2, verbosity=2)
result = runner.run(suite)
if result.failures or result.errors:
exit(1)
------------------------------ 8< -----------------------
----------------------------------------------------------------------
Comment By: Georg Brandl (gbrandl)
Date: 2007-03-16 14:02
Message:
Logged In: YES
user_id=849994
Originator: NO
Could you please state what exactly is missing from the documentation, in
your opinion?
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1681984&group_id=5470
More information about the Python-bugs-list
mailing list