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

Method check_wrapper

Lib/test/test_functools.py:832–848  ·  view source on GitHub ↗
(self, wrapper, wrapped,
                      assigned=functools.WRAPPER_ASSIGNMENTS,
                      updated=functools.WRAPPER_UPDATES)

Source from the content-addressed store, hash-verified

830class TestUpdateWrapper(unittest.TestCase):
831
832 def check_wrapper(self, wrapper, wrapped,
833 assigned=functools.WRAPPER_ASSIGNMENTS,
834 updated=functools.WRAPPER_UPDATES):
835 # Check attributes were assigned
836 for name in assigned:
837 self.assertIs(getattr(wrapper, name), getattr(wrapped, name))
838 # Check attributes were updated
839 for name in updated:
840 wrapper_attr = getattr(wrapper, name)
841 wrapped_attr = getattr(wrapped, name)
842 for key in wrapped_attr:
843 if name == "__dict__" and key == "__wrapped__":
844 # __wrapped__ is overwritten by the update code
845 continue
846 self.assertIs(wrapped_attr[key], wrapper_attr[key])
847 # Check __wrapped__
848 self.assertIs(wrapper.__wrapped__, wrapped)
849
850
851 def _default_update(self):

Callers 6

test_default_updateMethod · 0.95
test_no_updateMethod · 0.95
test_selective_updateMethod · 0.95
test_default_updateMethod · 0.80
test_no_updateMethod · 0.80
test_selective_updateMethod · 0.80

Calls 1

assertIsMethod · 0.45

Tested by

no test coverage detected