diff options
author | MelissaWM <melissawm@gmail.com> | 2020-09-26 14:12:09 -0300 |
---|---|---|
committer | MelissaWM <melissawm@gmail.com> | 2020-09-26 14:12:09 -0300 |
commit | d267252186be8cfe1f4c7bc743d4b4523620bb42 (patch) | |
tree | d923f8f62f485e8543b5b9b9221c9bcb31c513bc | |
parent | dbe6d464dbde074d207804e3aed1b3cfaacf0eda (diff) | |
download | numpy-d267252186be8cfe1f4c7bc743d4b4523620bb42.tar.gz |
Added textwrap.dedent to test.
-rw-r--r-- | numpy/f2py/tests/test_module_doc.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/numpy/f2py/tests/test_module_doc.py b/numpy/f2py/tests/test_module_doc.py index 9360b04a9..4b9555cee 100644 --- a/numpy/f2py/tests/test_module_doc.py +++ b/numpy/f2py/tests/test_module_doc.py @@ -1,6 +1,7 @@ import os import sys import pytest +import textwrap from . import util from numpy.testing import assert_equal, IS_PYPY @@ -18,5 +19,12 @@ class TestModuleDocString(util.F2PyTest): @pytest.mark.xfail(IS_PYPY, reason="PyPy cannot modify tp_doc after PyType_Ready") 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) + assert_equal(self.module.mod.__doc__, + textwrap.dedent('''\ + i : 'i'-scalar + x : 'i'-array(4) + a : 'f'-array(2,3) + b : 'f'-array(-1,-1), not allocated\x00 + foo()\n + Wrapper for ``foo``.\n\n''') + ) |