MCPcopy Create free account
hub / github.com/celery/celery / __new__

Method __new__

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

Source from the content-addressed store, hash-verified

797class MockCallbacks:
798
799 def __new__(cls, *args, **kwargs):
800 r = Mock(name=cls.__name__)
801 cls.__init__(r, *args, **kwargs)
802 for key, value in vars(cls).items():
803 if key not in ('__dict__', '__weakref__', '__new__', '__init__'):
804 if inspect.ismethod(value) or inspect.isfunction(value):
805 r.__getattr__(key).side_effect = _bind(value, r)
806 else:
807 r.__setattr__(key, value)
808 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