[Bug #1576241] Let functools.wraps work with built-in functions

This commit is contained in:
Andrew M. Kuchling 2006-10-27 16:42:19 +00:00
parent d2ee30b485
commit 3d6a834e29
3 changed files with 10 additions and 1 deletions

View file

@ -210,6 +210,13 @@ class TestUpdateWrapper(unittest.TestCase):
self.assertEqual(wrapper.attr, 'This is a different test')
self.assertEqual(wrapper.dict_attr, f.dict_attr)
def test_builtin_update(self):
# Test for bug #1576241
def wrapper():
pass
functools.update_wrapper(wrapper, max)
self.assertEqual(wrapper.__name__, 'max')
self.assert_(wrapper.__doc__.startswith('max('))
class TestWraps(TestUpdateWrapper):