MCPcopy
hub / github.com/celery/celery / __new__

Method __new__

t/unit/conftest.py:778–787  ·  view source on GitHub ↗
(cls, *args, **kwargs)

Source from the content-addressed store, hash-verified

776class MockCallbacks:
777
778 def __new__(cls, *args, **kwargs):
779 r = Mock(name=cls.__name__)
780 cls.__init__(r, *args, **kwargs)
781 for key, value in vars(cls).items():
782 if key not in ('__dict__', '__weakref__', '__new__', '__init__'):
783 if inspect.ismethod(value) or inspect.isfunction(value):
784 r.__getattr__(key).side_effect = _bind(value, r)
785 else:
786 r.__setattr__(key, value)
787 return r

Calls 5

_bindFunction · 0.85
__init__Method · 0.45
itemsMethod · 0.45
__getattr__Method · 0.45
__setattr__Method · 0.45

Tested by

no test coverage detected