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

Method test_selective_update

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

Source from the content-addressed store, hash-verified

893 self.assertNotHasAttr(wrapper, 'attr')
894
895 def test_selective_update(self):
896 def f():
897 pass
898 f.attr = 'This is a different test'
899 f.dict_attr = dict(a=1, b=2, c=3)
900 def wrapper():
901 pass
902 wrapper.dict_attr = {}
903 assign = ('attr',)
904 update = ('dict_attr',)
905 functools.update_wrapper(wrapper, f, assign, update)
906 self.check_wrapper(wrapper, f, assign, update)
907 self.assertEqual(wrapper.__name__, 'wrapper')
908 self.assertNotEqual(wrapper.__qualname__, f.__qualname__)
909 self.assertEqual(wrapper.__doc__, None)
910 self.assertEqual(wrapper.attr, 'This is a different test')
911 self.assertEqual(wrapper.dict_attr, f.dict_attr)
912
913 def test_missing_attributes(self):
914 def f():

Callers

nothing calls this directly

Calls 3

check_wrapperMethod · 0.95
assertNotEqualMethod · 0.80
assertEqualMethod · 0.45

Tested by

no test coverage detected