summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_pydoc.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_pydoc.py')
-rw-r--r--Lib/test/test_pydoc.py13
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):