mirror of
https://github.com/python/cpython.git
synced 2025-07-30 06:34:15 +00:00
#7930: fix stripid
This commit is contained in:
parent
6dfe66298b
commit
e511fc7979
2 changed files with 14 additions and 3 deletions
|
@ -291,6 +291,19 @@ class PyDocDocTest(unittest.TestCase):
|
|||
"white space was not stripped from module name "
|
||||
"or other error output mismatch")
|
||||
|
||||
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):
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue