[Zope-Checkins] CVS: Zope/lib/python/StructuredText/tests - testStructuredText.py:1.16

Guido van Rossum guido@python.org
Tue, 28 May 2002 13:55:09 -0400


> Modified Files:
> 	testStructuredText.py 
> Log Message:
> made doc strings unique
> 
> 
> === Zope/lib/python/StructuredText/tests/testStructuredText.py 1.15 => 1.16 ===
>      
>      def testUnderscoresInLiteral1(self):
> -        """ underscores in literals shouldn't do underlining """
> +        """ underscores in literals shouldn't do underlining (1)"""
>  
>          self._test("def __init__(self)",
>                     "def __init__(self)")
>  
>      def testUnderscoresInLiteral2(self):
> -        """ underscores in literals shouldn't do underlining """
> +        """ underscores in literals shouldn't do underlining (2)"""
>  
>          self._test("this is '__a_literal__' eh",
>                     "<code>__a_literal__</code>")
>  
>  
>      def testUnderlinesWithoutWithspaces(self):
> -        """ underscores in literals shouldn't do underlining """
> +        """ underscores in literals shouldn't do underlining (3)"""
>  
>          self._test("Zopes structured_text is sometimes a night_mare",
>                     "Zopes structured_text is sometimes a night_mare")

Wouldn't it be easier to remove the docstrings?  unittest insists on
displaying the docstring rather than the function name when a
docstring is present.  I find this a misfeature, because it makes it
hard to find the function (even the docstrings *are* unique :-).  As a
consequence, most unittests don't have docstrings, but rather use
comments if needed.  Why don't you follow this example?

--Guido van Rossum (home page: http://www.python.org/~guido/)