diff options
author | Andrew M. Kuchling <amk@amk.ca> | 2006-10-27 16:42:19 +0000 |
---|---|---|
committer | Andrew M. Kuchling <amk@amk.ca> | 2006-10-27 16:42:19 +0000 |
commit | 3d6a834e29f83d043bd0bb239000cd0361eb94f6 (patch) | |
tree | dd69f088b29c09723329c3f0547f1b3acea03cec /Lib/test/test_functools.py | |
parent | d2ee30b4851905b00fb77c67f828171b45b043ed (diff) | |
download | cpython-git-3d6a834e29f83d043bd0bb239000cd0361eb94f6.tar.gz |
[Bug #1576241] Let functools.wraps work with built-in functions
Diffstat (limited to 'Lib/test/test_functools.py')
-rw-r--r-- | Lib/test/test_functools.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_functools.py b/Lib/test/test_functools.py index 8dc185b721..6012f9f855 100644 --- a/Lib/test/test_functools.py +++ b/Lib/test/test_functools.py @@ -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): |