diff options
author | Ezio Melotti <ezio.melotti@gmail.com> | 2010-02-16 23:32:24 (GMT) |
---|---|---|
committer | Ezio Melotti <ezio.melotti@gmail.com> | 2010-02-16 23:32:24 (GMT) |
commit | bf839b90f46397439433188108267369e625aad1 (patch) | |
tree | 6170759bfbeda25d155fb7c301ba4be1afd5cf6f /Lib/test/test_pydoc.py | |
parent | 4d0a20a8934b4593ead77b3d2297add71ebadb38 (diff) | |
download | cpython-bf839b90f46397439433188108267369e625aad1.zip cpython-bf839b90f46397439433188108267369e625aad1.tar.gz cpython-bf839b90f46397439433188108267369e625aad1.tar.bz2 |
Merged revisions 78209 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
................
r78209 | ezio.melotti | 2010-02-17 01:31:04 +0200 (Wed, 17 Feb 2010) | 9 lines
Merged revisions 78207 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r78207 | ezio.melotti | 2010-02-17 01:26:09 +0200 (Wed, 17 Feb 2010) | 1 line
#7930: fix stripid
........
................
Diffstat (limited to 'Lib/test/test_pydoc.py')
-rw-r--r-- | Lib/test/test_pydoc.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Lib/test/test_pydoc.py b/Lib/test/test_pydoc.py index 76822af..b467d2c 100644 --- a/Lib/test/test_pydoc.py +++ b/Lib/test/test_pydoc.py @@ -302,6 +302,19 @@ class PyDocDocTest(unittest.TestCase): expected = missing_pattern % missing_module.strip() self.assertEqual(expected, result) + def test_stripid(self): + # test with strings, other implementations might have different repr() + stripid = pydoc.stripid + # strip the id + self.assertEqual(stripid('<function stripid at 0x88dcee4>'), + '<function stripid>') + self.assertEqual(stripid('<function stripid at 0x01F65390>'), + '<function stripid>') + # nothing to strip, return the same text + self.assertEqual(stripid('42'), '42') + self.assertEqual(stripid("<type 'exceptions.Exception'>"), + "<type 'exceptions.Exception'>") + class TestDescriptions(unittest.TestCase): |