diff options
author | Georg Brandl <georg@python.org> | 2008-06-07 15:59:10 +0000 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2008-06-07 15:59:10 +0000 |
commit | 7be19aabe20a04d8038383bc96c3dd96f27892c0 (patch) | |
tree | 535f4ab7bff1301239a2c5f3f2d7492c0ab5634b /Lib/test/test_inspect.py | |
parent | 6a5a177cba3aa36e53438901a1a52149b9010e92 (diff) | |
download | cpython-git-7be19aabe20a04d8038383bc96c3dd96f27892c0.tar.gz |
Factor out docstring dedenting from inspect.getdoc() into inspect.cleandoc()
to ease standalone use of the algorithm.
Diffstat (limited to 'Lib/test/test_inspect.py')
-rw-r--r-- | Lib/test/test_inspect.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_inspect.py b/Lib/test/test_inspect.py index ef84f44f6c..32eeb57d31 100644 --- a/Lib/test/test_inspect.py +++ b/Lib/test/test_inspect.py @@ -185,6 +185,10 @@ class TestRetrievingSourceCode(GetSourceBase): self.assertEqual(inspect.getdoc(git.abuse), 'Another\n\ndocstring\n\ncontaining\n\ntabs') + def test_cleandoc(self): + self.assertEqual(inspect.cleandoc('An\n indented\n docstring.'), + 'An\nindented\ndocstring.') + def test_getcomments(self): self.assertEqual(inspect.getcomments(mod), '# line 1\n') self.assertEqual(inspect.getcomments(mod.StupidGit), '# line 20\n') |