[Scipy-svn] r4862 - in trunk/scipy/stats: . tests
scipy-svn at scipy.org
scipy-svn at scipy.org
Wed Oct 29 18:42:41 EDT 2008
Author: ptvirtan
Date: 2008-10-29 17:42:23 -0500 (Wed, 29 Oct 2008)
New Revision: 4862
Modified:
trunk/scipy/stats/distributions.py
trunk/scipy/stats/tests/test_distributions.py
Log:
Fix #761
Modified: trunk/scipy/stats/distributions.py
===================================================================
--- trunk/scipy/stats/distributions.py 2008-10-28 05:33:09 UTC (rev 4861)
+++ trunk/scipy/stats/distributions.py 2008-10-29 22:42:23 UTC (rev 4862)
@@ -325,7 +325,7 @@
longname = hstr + name
if self.__doc__ is None:
self.__doc__ = rv_continuous.__doc__
- else:
+ if self.__doc__ is not None:
self.__doc__ = self.__doc__.replace("A Generic",longname)
if name is not None:
self.__doc__ = self.__doc__.replace("generic",name)
@@ -3408,7 +3408,7 @@
longname = hstr + name
if self.__doc__ is None:
self.__doc__ = rv_discrete.__doc__
- else:
+ if self.__doc__ is not None:
self.__doc__ = self.__doc__.replace("A Generic",longname)
if name is not None:
self.__doc__ = self.__doc__.replace("generic",name)
Modified: trunk/scipy/stats/tests/test_distributions.py
===================================================================
--- trunk/scipy/stats/tests/test_distributions.py 2008-10-28 05:33:09 UTC (rev 4861)
+++ trunk/scipy/stats/tests/test_distributions.py 2008-10-29 22:42:23 UTC (rev 4862)
@@ -216,5 +216,13 @@
def test_zero(self):
assert_equal(stats.expon.pdf(0),1)
+class TestDocstring(TestCase):
+ def test_docstrings(self):
+ """See ticket #761"""
+ if stats.rayleigh.__doc__ is not None:
+ self.failUnless("rayleigh" in stats.rayleigh.__doc__.lower())
+ if stats.bernoulli.__doc__ is not None:
+ self.failUnless("bernoulli" in stats.bernoulli.__doc__.lower())
+
if __name__ == "__main__":
run_module_suite()
More information about the Scipy-svn
mailing list