MCPcopy Index your code
hub / github.com/python/cpython / test_no_update

Method test_no_update

Lib/test/test_functools.py:880–893  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

878 self.assertEqual(wrapper.__doc__, 'This is a test')
879
880 def test_no_update(self):
881 def f():
882 """This is a test"""
883 pass
884 f.attr = 'This is also a test'
885 def wrapper():
886 pass
887 functools.update_wrapper(wrapper, f, (), ())
888 self.check_wrapper(wrapper, f, (), ())
889 self.assertEqual(wrapper.__name__, 'wrapper')
890 self.assertNotEqual(wrapper.__qualname__, f.__qualname__)
891 self.assertEqual(wrapper.__doc__, None)
892 self.assertEqual(wrapper.__annotations__, {})
893 self.assertNotHasAttr(wrapper, 'attr')
894
895 def test_selective_update(self):
896 def f():

Callers

nothing calls this directly

Calls 4

check_wrapperMethod · 0.95
assertNotEqualMethod · 0.80
assertNotHasAttrMethod · 0.80
assertEqualMethod · 0.45

Tested by

no test coverage detected