MCPcopy Index your code
hub / github.com/RustPython/RustPython / decorate_class

Method decorate_class

Lib/unittest/mock.py:1392–1403  ·  view source on GitHub ↗
(self, klass)

Source from the content-addressed store, hash-verified

1390
1391
1392 def decorate_class(self, klass):
1393 for attr in dir(klass):
1394 if not attr.startswith(patch.TEST_PREFIX):
1395 continue
1396
1397 attr_value = getattr(klass, attr)
1398 if not hasattr(attr_value, "__call__"):
1399 continue
1400
1401 patcher = self.copy()
1402 setattr(klass, attr, patcher(attr_value))
1403 return klass
1404
1405
1406 @contextlib.contextmanager

Callers 1

__call__Method · 0.95

Calls 6

copyMethod · 0.95
dirFunction · 0.85
getattrFunction · 0.85
hasattrFunction · 0.85
setattrFunction · 0.85
startswithMethod · 0.45

Tested by

no test coverage detected