[Zope3-dev] Re: [Zope-Checkins] CVS: Zope3/src/persistent/tests - test_persistent.py:1.5 persistent.txt:1.2

Marius Gedminas mgedmin at b4net.lt
Mon Mar 8 12:03:09 EST 2004


On Mon, Mar 08, 2004 at 09:24:21AM -0500, Jim Fulton wrote:
> >What's wrong with docstrings in unit tests?
> 
> The docstrings aren't interspuursed with the code.
> 
> Bonus, the unittest uses docstrings, if present, in test reports,
> which usually makes it hard to tell what test was being run.

You can easily disable this feature of unittest by passing a
descriptions=False argument to ImmediateTestRunner.

> As a
> result, we specifically ask people *not* to write doc strings for
> test methods.

Wouldn't it be better to make the test runner ignore them and then
actually encourage people to write doc strings if they make unit tests
easier to read and understand?

Should I commit the following patch?

--- test.py     20 Feb 2004 16:56:40 -0000      1.85
+++ test.py     8 Mar 2004 16:59:26 -0000
@@ -617,7 +617,8 @@

 def runner(files, test_filter, debug):
     runner = ImmediateTestRunner(verbosity=VERBOSE, debug=debug,
-                                 progress=progress, profile=profile)
+                                 progress=progress, profile=profile,
+                                 descriptions=False)
     suite = unittest.TestSuite()
     for file in files:
         s = get_suite(file)


Marius Gedminas
-- 
Science is to computer science as hydrodynamics is to plumbing.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 232 bytes
Desc: Digital signature
Url : http://mail.zope.org/pipermail/zope3-dev/attachments/20040308/e27a8e84/attachment.bin


More information about the Zope3-dev mailing list