diff options
author | Pauli Virtanen <pav@iki.fi> | 2012-11-17 19:31:19 +0200 |
---|---|---|
committer | Pauli Virtanen <pav@iki.fi> | 2012-11-17 19:59:38 +0200 |
commit | ab13a65447d245e64b59c466827b2415d77ec186 (patch) | |
tree | f4befdae2a7b7c058397c1a28beba14197465706 /numpy/f2py/tests | |
parent | 3418ffc228a8eaa414f66879301b228d4fc029e8 (diff) | |
download | numpy-ab13a65447d245e64b59c466827b2415d77ec186.tar.gz |
ENH: f2py: generate docstrings in Numpy docstring format
Diffstat (limited to 'numpy/f2py/tests')
-rw-r--r-- | numpy/f2py/tests/test_callback.py | 25 | ||||
-rw-r--r-- | numpy/f2py/tests/test_mixed.py | 5 |
2 files changed, 30 insertions, 0 deletions
diff --git a/numpy/f2py/tests/test_callback.py b/numpy/f2py/tests/test_callback.py index 6a201a951..3ed6d1da5 100644 --- a/numpy/f2py/tests/test_callback.py +++ b/numpy/f2py/tests/test_callback.py @@ -38,6 +38,31 @@ cf2py intent(out) a for name in "t,t2".split(","): self.check_function(name) + @dec.slow + def test_docstring(self): + assert_equal(self.module.t.__doc__, + "a = t(fun,[fun_extra_args])\n" + "\n" + "Parameters\n" + "----------\n" + "fun : call-back function\n" + "\n" + "Other Parameters\n" + "----------------\n" + "fun_extra_args : input tuple, optional\n" + " Default: ()\n" + "\n" + "Returns\n-------\n" + "a : int\n" + "\n" + "Notes\n" + "-----\n" + "Call-back functions::\n" + "\n" + " def fun(): return a\n" + " Return objects:\n" + " a : int\n") + def check_function(self, name): t = getattr(self.module, name) r = t(lambda : 4) diff --git a/numpy/f2py/tests/test_mixed.py b/numpy/f2py/tests/test_mixed.py index a8a14ca4b..70a1d7c66 100644 --- a/numpy/f2py/tests/test_mixed.py +++ b/numpy/f2py/tests/test_mixed.py @@ -20,6 +20,11 @@ class TestMixed(util.F2PyTest): assert_( self.module.foo_fixed.bar12() == 12) assert_( self.module.foo_free.bar13() == 13) + @dec.slow + def test_docstring(self): + assert_equal(self.module.bar11.__doc__, + "a = bar11()\n\nReturns\n-------\na : int\n") + if __name__ == "__main__": import nose nose.runmodule() |