diff options
Diffstat (limited to 'numpy/f2py/tests')
-rw-r--r-- | numpy/f2py/tests/src/module_data/mod.mod | bin | 0 -> 412 bytes | |||
-rw-r--r-- | numpy/f2py/tests/src/module_data/module_data_docstring.f90 | 12 | ||||
-rw-r--r-- | numpy/f2py/tests/test_block_docstring.py | 2 | ||||
-rw-r--r-- | numpy/f2py/tests/test_module_doc.py | 16 |
4 files changed, 29 insertions, 1 deletions
diff --git a/numpy/f2py/tests/src/module_data/mod.mod b/numpy/f2py/tests/src/module_data/mod.mod Binary files differnew file mode 100644 index 000000000..8670a97e9 --- /dev/null +++ b/numpy/f2py/tests/src/module_data/mod.mod diff --git a/numpy/f2py/tests/src/module_data/module_data_docstring.f90 b/numpy/f2py/tests/src/module_data/module_data_docstring.f90 new file mode 100644 index 000000000..4505e0cbc --- /dev/null +++ b/numpy/f2py/tests/src/module_data/module_data_docstring.f90 @@ -0,0 +1,12 @@ +module mod + integer :: i + integer :: x(4) + real, dimension(2,3) :: a + real, allocatable, dimension(:,:) :: b +contains + subroutine foo + integer :: k + k = 1 + a(1,2) = a(1,2)+3 + end subroutine foo +end module mod diff --git a/numpy/f2py/tests/test_block_docstring.py b/numpy/f2py/tests/test_block_docstring.py index e431f5ba6..7d725165b 100644 --- a/numpy/f2py/tests/test_block_docstring.py +++ b/numpy/f2py/tests/test_block_docstring.py @@ -19,5 +19,5 @@ class TestBlockDocString(util.F2PyTest): @pytest.mark.xfail(IS_PYPY, reason="PyPy cannot modify tp_doc after PyType_Ready") def test_block_docstring(self): - expected = "'i'-array(2,3)\n" + expected = "bar : 'i'-array(2,3)\n" assert_equal(self.module.block.__doc__, expected) diff --git a/numpy/f2py/tests/test_module_doc.py b/numpy/f2py/tests/test_module_doc.py new file mode 100644 index 000000000..f597929ad --- /dev/null +++ b/numpy/f2py/tests/test_module_doc.py @@ -0,0 +1,16 @@ +import os +from . import util + +from numpy.testing import assert_equal + + +def _path(*a): + return os.path.join(*((os.path.dirname(__file__),) + a)) + + +class TestModuleDocString(util.F2PyTest): + sources = [_path('src', 'module_data', 'module_data_docstring.f90')] + + def test_module_docstring(self): + expected = "i : 'i'-scalar\nx : 'i'-array(4)\na : 'f'-array(2,3)\nb : 'f'-array(-1,-1), not allocated\x00\nfoo()\n\nWrapper for ``foo``.\n\n" + assert_equal(self.module.mod.__doc__, expected) |